I want the model to move forward go back to start then repeat forever but it won't move at all and there are no errors
workspace.Road.PrimaryPart = workspace.Road.Center while true do for i = 1,100 do wait(0.01) workspace.Road.SetPrimaryPartCFrame(CFrame.new(workspace.Road.PrimaryPart.Position + Vector3.new(0,0,1))) end wait(0.01) for i = 1,1 do wait(0.01) workspace.Road.SetPrimaryPartCFrame(CFrame.new(workspace.Road.PrimaryPart.Position - Vector3.new(0,0,100))) end wait(0.01) end
The problem is you're using .SetPrimaryPartCFrame, while the correct way is using ":" just like so :SetPrimaryPartCFrame. So here is how the script is:
workspace.Road.PrimaryPart = workspace.Road.Center while true do for i = 1,100 do wait(0.01) workspace.Road:SetPrimaryPartCFrame(CFrame.new(workspace.Road.PrimaryPart.Position + Vector3.new(0,0,1))) end wait(0.01) for i = 1,1 do wait(0.01) workspace.Road:SetPrimaryPartCFrame(CFrame.new(workspace.Road.PrimaryPart.Position - Vector3.new(0,0,100))) end wait(0.01) end
That's because the function :SetPrimaryPartCFrame is a inbuilt function by roblox which moves a model you forgot to add the COLON on :SetPrimaryPartCFRAME
To learn more about SetPrimaryPartCFrame: https://developer.roblox.com/en-us/api-reference/function/Model/SetPrimaryPartCFrame