GGLQ
|
  |
| Joined: 31 Mar 2016 |
| Total Posts: 32 |
|
|
| 27 Jun 2016 04:18 AM |
How can I use wait() in normal lua?That command from Roblox won't work! EX:while true do print("Hi") wait() end |
|
|
| Report Abuse |
|
|
| 27 Jun 2016 04:21 AM |
You cannot, as what would be happening in the meantime? You can maybe do a system call, or just busy wait.
An example of busy-waiting: local function wait(n) local start = os.clock() while os.clock() < start do end end
It's not great because it just hogs up all the resources doing literally nothing, you might want to create some sort of thread scheduler so you can switch between threads when they yield. |
|
|
| Report Abuse |
|