When I click a model moves to 1,1,1 but when I click again, I want the model to move where it was before you clicked the first time.
Part = script.Parent Model = game.Workspace:WaitForChild("Model") Part.ClickDetector.MouseClick:connect(function() Model:MoveTo(Vector3.new(1,1,1)) end)
You need to save the coordinates of where it was in the first place
local x, y, z = 0, 0, 0 part.ClickDetector.MouseClick:connect(function() if Model.Position.X ~= 1 and Model.Position.Y ~= 1 and Model.Position.Z ~= 1 then x = Model.Position.X y = Model.Position.Y z = Model.Position.Z Model:MoveTo(Vector3.new(1,1,1)) else Model:MoveTo(Vector3.new(x,y,z)) end end)