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 |
|
|
| |
|
|
| 13 Jun 2017 08:13 PM |
@TitanicKungfubot
You are not a nice person :O |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 14 Jun 2017 02:51 PM |
| u cant wait any less than the engine can so |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|