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: Wait() different results in studio vs on the website

Previous Thread :: Next Thread 
hamid1455 is not online. hamid1455
Joined: 25 Mar 2017
Total Posts: 116
13 Jun 2017 08:04 PM
I noticed when I use say like wait(0.05) in a script and test it within roblox studio, it runs faster and if I play the same script from the website player it runs slower. Does it run slower on the website because of roblox server or is there a way to get the same result both locally and from the website? Thanks.
Report Abuse
TitanicKungfubot is not online. TitanicKungfubot
Joined: 25 Dec 2016
Total Posts: 3482
13 Jun 2017 08:07 PM
you are an idiot


Report Abuse
ScriptRestored is not online. ScriptRestored
Joined: 19 Mar 2011
Total Posts: 111
13 Jun 2017 08:13 PM
@TitanicKungfubot

You are not a nice person :O
Report Abuse
hamid1455 is not online. hamid1455
Joined: 25 Mar 2017
Total Posts: 116
14 Jun 2017 12:25 PM
Ok I read that the minimum value that wait can use is 0.03 I think. So I read about RenderStepped and wanted to ask if it's possible to use RenderStepped but control the time after which it is run.
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
14 Jun 2017 12:31 PM
local runService = game:GetService("RunService")
local fastestWait
if runService:IsClient() then
fastestWait = runService.RenderStepped
else
fastestWait = runService.Heartbeat
end

print(tick())
fastestWait:wait()
print(tick())
Report Abuse
hamid1455 is not online. hamid1455
Joined: 25 Mar 2017
Total Posts: 116
14 Jun 2017 02:49 PM
I'm using RenderStepped now and it works better than before but it's still only 1/60 of a second, I need 1/200 of a second. How would I go about doing that? I read somewhere that you can use coroutines to get a 0.001 wait(), so maybe I will try looking into that. Thanks for the reply Wunder_Wulfe.
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
14 Jun 2017 02:51 PM
u cant wait any less than the engine can so
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
14 Jun 2017 02:52 PM
if u need 1/200th of a second then i recommend just doing it for 1/60th of a second but increasing the change
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
14 Jun 2017 02:53 PM
e.g. instead of

for i=0,200 do
--wait 1/200
print(i/200)
end

do

for i=0,60 do
--wait 1/60
print(i/60)
end
Report Abuse
hamid1455 is not online. hamid1455
Joined: 25 Mar 2017
Total Posts: 116
14 Jun 2017 03:03 PM
Ok nevermind, 1/60 of a second was fine, I was using 0.1 in the RenderStepped:wait() so that's why it was slower. I changed it to 0.05 and it was fine. Thanks for the help guys.
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