My attempt at making a platform that goes back and forth is considered to be a failure. Is it okay to put a while loop in as while loop? This is my code:
while true do
while true do
script.Parent.CFrame=script.Parent.CFrame+Vector3.new(0,0,.5)
wait()
end
script.Parent.BrickColor=BrickColor.new("Bright blue")
wait(5)
while true do
script.Parent.CFrame=script.Parent.CFrame-Vector3.new(0,0,.5)
wait()
end
script.Parent.BrickColor=BrickColor.new("Bright orange")
wait(5)
end

1 comment
So, I can create a coroutine, put my code in there, yield it, and let a section of the code run when I call it?