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

I tried to make a loop with this but it won't work. Can you guys help?

Asked by 9 years ago

I tried it, and it works once and never loops.

local thrust = Instance.new("BodyVelocity")
    thrust.velocity = Vector3.new(0,10,0)
    thrust.maxForce = Vector3.new(0,4e+050,0)
    thrust.Parent = script.Parent.Torso 
wait(2)
script.Parent.Torso.BodyVelocity:remove()
wait(4)

1 answer

Log in to vote
0
Answered by 9 years ago
while true do
wait()
local thrust = Instance.new("BodyVelocity")
    thrust.velocity = Vector3.new(0,10,0)
    thrust.maxForce = Vector3.new(0,4e+050,0)
    thrust.Parent = script.Parent.Torso 
wait(2)
script.Parent.Torso.BodyVelocity:remove()
wait(4)
end
0
Thank You Anthony9960 210 — 9y
0
Oh and here is another way to loop while wait() do and remove the wait() under while true do :D Also repeat works. fireboltofdeath 635 — 9y
Ad

Answer this question