When comparing speed of mini game in studio and in roblox it just got alot of difference
but heck, code the same!
In roblox:
robloxapp-20241229-2021533.wmv (1,2 МБ)
In studio:
The Code is same:
When comparing speed of mini game in studio and in roblox it just got alot of difference
but heck, code the same!
In roblox:
robloxapp-20241229-2021533.wmv (1,2 МБ)
In studio:
The Code is same:
I recommend you to use task.wait()
; Essentially, it’s an improved (a lot more precise) version of wait()
.
You can read more about it here:
I wouldn’t do:
while task.wait() do
--task
end
either. Instead, I’d do:
while true do
--task
task.wait()
end
But really, it’s best to avoid forever loops and take an event based approach instead.
i am just replace every wait() to task.wait()
bruh, hope this works huh
For once. The actual suggestion of replacing wait with task.wait() might actually fix your problem. wait is allowed to throttle according to the docs, but I don’t think task.wait is allowed to. (I swear task.wait() is proposed as a solution to every problem, so it actually potentially being the solution is kind of funny imo)
Though it’s also worth noting there is a minimum time for d. I’m not sure what the number actually is, but if it exceeds min it will slow down. A more robust version of this is to do a per frame loop and just move on based on elapsed time per frame, but that might be overkill if the task.wait() solution works.
it still didn’t helped, even i placed task.wait()
yo are game.RunService.HeartBeat are good idea?
Part of this could be that it’s on the server and is therefore subject to latency, though ideally latency is consistent and so won’t be a problem.
What I propose as a solution is to instead of looping the way you are, bind it to heartbeat and track the time passed in a variable t. And just do if statements to allow the most recent part to update positions of t is bigger than what it needs to activate.
Also as a note. You may want to copy/paste the text of code in the future instead of supply an image. That way people can copy your code and more easily show you how proposed changes should look.
The answer is it depends. Probably yes, so long as you are being efficient with it.
You might wanna do this on the client instead.
Also, use Ctrl + Shift + F to avoid the hurdle of manually replacing matches.
oh thanks! very useful, i guess…
The announcement introducing the Task Library (linked in my last post) states that doing this:
task.wait()
is just syntactic sugar for:
RunService.Heartbeat:Wait()
so, the latter should yield the same results, if you were wondering about using it.
mentioned that one thing, i see it starting throttling exactly when players amount getting high. and this is now also affects to tweens what makes me really angry >:(
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.