Ok, I have made a script to make script.parent go up then in ten seconds go down. I dont know why, but what it does is it goes up, then goes up again without going down.... Help please
while true do wait() for i= 1, 50 do script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,0.28,0) wait() end wait(10) for i= 1, 50 do script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,-0.28,0) wait() end end``
The issue here is after it goes down, it waits a single frame before starting the loop again. Also, I would recommend putting an actual value on the wait to show the part transitioning. It would look like this:
while true do wait() for i= 1, 50 do script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,0.28,0) wait(0.05) end wait(10) for i= 1, 50 do script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,-0.28,0) wait(0.05) end wait(10) end