Hello, I would like to make a script test if a bool value is true or false. if is false then end and repeat but if it is true it would activate the c-frame.
Here is what I wrote.
if game.Workspace.Arm.Begin.Value == false then end if game.Workspace.Arm.Begin.Value == true then do distance = 5 for i = 0, distance do script.Parent.CFrame = script.Parent.CFrame-Vector3.new(1,0.0,0) wait(00.010) end for i = 0, distance do script.Parent.CFrame = script.Parent.CFrame+Vector3.new(1,0.0,0) wait(00.010) end
Ok so the only error was that you have to get rid of the "do" on line 6 so the code will be
if game.Workspace.Arm.Begin.Value == false then end if game.Workspace.Arm.Begin.Value == true then distance = 5 for i = 0, distance do script.Parent.CFrame = script.Parent.CFrame-Vector3.new(1,0.0,0) wait(00.010) end for i = 0, distance do script.Parent.CFrame = script.Parent.CFrame+Vector3.new(1,0.0,0) wait(00.010) end