Milllk Posted September 19, 2015 Share Posted September 19, 2015 how can i set cooldown for invoking a function like this,i have a function here local somefuc() local creature = SpawnPrefab("prefab"... doTaskIntime("creature",10) end how can i set the player only can invoke once during 10 sec? is there any time function i can use? Link to comment Share on other sites More sharing options...
ZupaleX Posted September 19, 2015 Share Posted September 19, 2015 You can make a use of GetTime() and store the last invoke time as well, so when the player try to invoke, it would perform a check like if GetTime() - lastinvoketime < 10 then returnelse DoYourStuffsend Link to comment Share on other sites More sharing options...
Milllk Posted September 19, 2015 Author Share Posted September 19, 2015 You can make a use of GetTime() and store the last invoke time as well, so when the player try to invoke, it would perform a check like if GetTime() - lastinvoketime < 10 then returnelse DoYourStuffsendthank you a lot ,ill try it out Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now