Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Is it possible to make the for loop run and go faster?

Asked by
TtuNkK 37
4 years ago
for i = 1, 90 do        
    wait(.01)       
    if i <= 35 then
        gomuArm.Size = gomuArm.Size - Vector3.new(0, .5, 0)
    else
        gomuArm.Size = gomuArm.Size + Vector3.new(0, .5, 0)
    end
    gomuWeld.C1 = gomuWeld.C1 * CFrame.new(0.239, -0.016, 0.072)
end

Is it possible to make this loop go faster? I tried to wait(.001), but it doesn't seem it works. Any advice and assistance?

2 answers

Log in to vote
0
Answered by
synkrio 281 Moderation Voter
4 years ago
Edited 4 years ago

The shortest time that wait() allows is .033 seconds. Use RunService.RenderStepped:Wait() or Heartbeat:Wait() to decrease that time to about .016 seconds

Ad
Log in to vote
0
Answered by 4 years ago

Howdy!

Short Answer: Not really.

Long Answer: Probably but not with Roblox. You're asking to speed communications from the client to the server then back to the clients. You COULD probably change the game settings in Roblox Studio through File > Settings but I've never touched those nor trusted myself to do so. I could be wrong, but who knows?

If this helped you out, consider accepting this answer for those sweet, sweet reputation points. If not, comment below and I (or someone else) will help you out.

Be sure to check out the Roblox API Documentation as well for additional reference.

Answer this question