So I tried to make a laser go up and down but I can't do it! It just goes under where I want it to go. This is what I put if you need some info for it. Please fix the errors
local var1 = 0 repeat for i=1,7 do wait(0.3) script.Parent.CFrame = script.Parent.CFrame+Vector3.new(0,1,0) for o=1,7 do wait(0.3) script.Parent.CFrame = script.Parent.CFrame-Vector3.new(0,1,0) end end until var1==10
The error with your script is that you can't subtract CFrames. Also, your ends were misplaced.
while wait(0) do for i=1,7, 0.5 do wait(0)--I cut the increment and the wait()s in half to smooth the movement for ya script.Parent.CFrame = CFrame.new(script.Parent.CFrame.p+Vector3.new(0, 0.5, 0))) end for o=1,7,0.5 do wait(0) script.Parent.CFrame = CFrame.new(script.Parent.CFrame.p-Vector3.new(0, 0.5, 0))) end end