Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Got this error [ Expected identifier when parsing expression, got 'for'] can anyone help me fix it?

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.

1 comment

0

Could you show the full output?

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.