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 » Scripters
Home Search
 

Re: Can you help me with this little problem in lua?

Previous Thread :: Next Thread 
GGLQ is not online. 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
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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