Raven5887
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 3184 |
|
|
| 31 Jan 2012 09:56 AM |
In my thinking, a 'script' in roblox is a LuaThread with a defferent environment. And when that environment's wait method is called the thread will be yielded and resumed after the given time has passed, or if no function parameter was given in the next frame by the game-loop.
If this assumption of mine is correct, then what happens when you call _G.wait or a global function with a wait in it. Is the calling thread yielded or the global thread. Or more importantly in the case of a custom global function with a wait in it, the script in which the function was made? |
|
|
| Report Abuse |
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 31 Jan 2012 10:04 AM |
function a() wait(10) end
print("Hello") a() print("How are you today?")
"Hello" will print, then it will wait 10 seconds to print "How are you today?".
Sorry if I didn't understand the question, but you said something about a custom global function.
Script one:
function _G.a() wait(10) end
Script two:
print("Hello") _G.a() print("How are you today?")
This has the same output as the script before. It will still wait 10 seconds. |
|
|
| Report Abuse |
|