[Help] Timer Delay for a Function
Hello everyone. I need help delaying return true for function. Precisely, I need to delay function when Geralt started walking, then after a given time, the function should return true. I tried different methods, nothing worked. Here my last attempt in code:
It's don't work as intended, the function return true, but there is no delay. Problem is I don't really know how to code, so if somebody could help me with that, it would be great. =)
Hello everyone. I need help delaying return true for function. Precisely, I need to delay function when Geralt started walking, then after a given time, the function should return true. I tried different methods, nothing worked. Here my last attempt in code:
PHP:
private function WalkActivationDelay () : bool {
var walkingTime : float;
if (thePlayer.GetIsWalking() && !thePlayer.GetIsRunning())
{
walkingTime = theGame.GetEngineTimeAsSeconds();
}
if (theGame.GetEngineTimeAsSeconds() + (walkingTime - 1) > 2 )
{
return true;
}
return false;
}
It's don't work as intended, the function return true, but there is no delay. Problem is I don't really know how to code, so if somebody could help me with that, it would be great. =)