dois raios Posted November 21, 2022 Share Posted November 21, 2022 (edited) If i put like this inst.DoTaskInTime(2, myfunction, 3) Does it mean my function will happen after 3 seconds? Edited November 21, 2022 by dois raios Link to comment Share on other sites More sharing options...
CarlZalph Posted November 21, 2022 Share Posted November 21, 2022 49 minutes ago, dois raios said: If i put like this inst.DoTaskInTime(2, myfunction, 3) Does it mean my function will happen after 3 seconds? No, it will error as it is with the dot syntax. Presuming you fix that to be inst:DoTaskInTime, then it'll run after 2 seconds and run myfunction with arguments (inst, 3) passed into it. You can read more into the behaviour of this in scripts/entityscript.lua and scripts/scheduler.lua. The initial delay part works for DoPeriodicTask. inst:DoPeriodicTask(2, myfunction, 3) will invoke the timer after 3 seconds, and then repeat every 2 seconds, and pass only (inst) to the callback myfunction. 2 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