I used the script that was my answer, but didn't solve my problem
local platform = workspace.Platform local stop1, stop2 = workspace.Stop1 or workspace.Stop2 stop1.Touched:connect(function(hit) if hit==platform then print("Stop1 touched the platform") hit.CFrame = platform.CFrame * CFrame.new(0,0,.1) end end) stop2.Touched:connect(function(hit) if hit==platform then print("Stop1 touched the platform") hit.CFrame = platform.CFrame * CFrame.new(0,0,-.1) end end)
The problem is that it won't move
"onTouched" is not a built in function. And if it was, you still didn't call it in your code. You also don't need a loop, and you can't add a Vector3 to a CFrame. Try studying this code:
local platform = workspace.Platform local stop1, stop2 = workspace.Stop1, workspace.Stop2 platform.Touched:connect(function(hit) if hit==stop1 then print("Stop1 touched the platform") hit.CFrame = platform.CFrame * CFrame.new(0,0,10) elseif hit==stop2 then print("Stop2 touched the platform") hit.CFrame = platform.CFrame * CFrame.new(0,0,-10) end end)