NoviceWithManyProblems Posted April 24, 2020 Share Posted April 24, 2020 how can i make only once time Timer? myTimer = setTimer(function() outputChatBox("only one time") killTimer(myTimer) end, 1000, 0) i have error: bad argument @ 'killTimer' expected Lua-timer at argument 1, got nil (killTimer(myTimer) Link to comment
Overkillz Posted April 24, 2020 Share Posted April 24, 2020 You dont need to use killTimer due to setTimer function already has an argument which allow you to execute the same function x times. myTimer = setTimer(function() outputChatBox("only one time") end, 1000, 1) --HERE IT IS, The las value '1' are the times that it is going to be executed. For future cases, if you want to use killTimer function, be aware that you have to check first if the timer exists using the function. isTimer() Regards. 1 Link to comment
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