Discord
Login
Community
DARK THEME

how do you make a wait()/sleep in lua microscript?

I've tried after and every functions and the sleep function wont work SyntaxError: [string "source"]:72: syntax error near '99', in file "source" at line 72 keeps appearing

You can make the project public - then you will be able to provide its link and other programmers will see the project source code.

wait and sleep functions in other languages ​​usually stop the entire program / thread.

In microScript it works like this

sleep 1 second

You probably want something to be executed after a certain time. If so, you need to

  1. remember the start time of the countdown to the end of the event.
init = function()
  start = system.time()
end

update = function()
  if system.time() - startTime > 5000 then print( "Time end") end
end
  1. use the MicroScript 2.0 function
after 5 seconds do
   call_This_Function()
end

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community