local run = false while wait() do if run == true then return for i= 1, 300 do script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,0,2) wait() end for i= 1, 300 do script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,0,-2) wait() wait(2) end script.Parent.CFrame = game.Workspace.SubPos1.CFrame run = true
This is a script for a car that goes down a track, i'm trying to make it to where when it reaches 'run = true' at the bottom that it repeats the action again.
Unfortunately, there is not much I can help you with as you didn’t show the full output. I recommend using the site https://developer.roblox.com/en-us/articles/Roblox-Coding-Basics-Loops