generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Two questions about wait()

Previous Thread :: Next Thread 
Raven5887 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image