I’m trying to make a code where if a player were to touch a certain part they would moveto a certain position but the player can cancel the moveto by moving around.’
My goal is to force the player to moveto a certain position without the moveto being canceled on player movement.
This is the code I’m using
local part = script.Parent
part.Touched:Connect(function(human)
wait()
local player = game.Players:GetPlayerFromCharacter(human.Parent)
if player then
local person = player.Character
local lime = game.Workspace.Lime.Position
person.Humanoid:MoveTo(lime)
print("touched")
end
end)
The script is in a part