I've made three parts https://gyazo.com/4d971ebdcba72624686f0ac22fb76e4b
and the middle one goes back and forth bettween the two other parts all the time. the script is
local start = game.Workspace.MovingModel.Start local finish = game.Workspace.MovingModel.Finish local bodyposition = game.Workspace.MovingModel.Platform.BodyPosition while true do bodyposition.Position = start.Position wait(2) bodyposition.Position = finish.Position wait(2) end
I want to be able to press a text button and the middle one goes back and forth once is that possible?
You would make a function and bind it to TextButton.MouseButton1Click so something like this:
function onClick() bodyposition.Position = start.Position wait(2) bodyposition.Position = finish.Position wait(2) end TextButton.MouseButton1Click:Connect(onClick) -- remember when you are binding a function, you are **NOT** calling it, so don't use () instead just reference it