I have a script that is supposed to make a spawn go up and down continuously... But it doesn't work. (This script is a regular script inside of a spawn)
spawn = script.Parent function UpAndDown() for i = 0, 4, 0.1 do spawn.CFrame = CFrame.new(0, 0.1, 0) wait(0.1) end for i = 0, -4, -0.1 do spawn.CFrame = CFrame.new(0, -0.1, 0) wait(0.1) end UpAndDown() end UpAndDown()
I changed a few things, but it's pretty simple. It should work now. If you want it to be continuous all you have to do is introduce a loop (while true do).
spawn = script.Parent function UpAndDown() for i = 0, 4, 0.1 do spawn.CFrame = spawn.CFrame + Vector3.new(0, 0.1, 0) wait(0.1) end for i = 0, 4, 0.1 do spawn.CFrame = spawn.CFrame - Vector3.new(0, 0.1, 0) wait(0.1) end end while true do UpAndDown() wait(1) end