script.Parent.Touched:Connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) local object = player.Character local ls = player.leaderstats local sl = game.Workspace:FindFirstChild(ls.Stage.Value) object.Torso.CFrame = sl.CFrame + Vector3.new(0,3,0) print(num) --shows that it repeats twice num = num + 1 end)
The Event you’re Connecting too is causing this issue, .Touched
can fire multiple times in a few seconds, as simply moving will reenable the function once again, easy fix though, you just need to add a debounce, it would look somewhat like this compared to your Script.
local part = script.Parent local touched = false part.Touched:Connect(function(hit) if touched then return end if (hit) ~= nil) then touched = true local player = game.Players:GetPlayerFromCharacter(hit.Parent) local character = player.Character or player.CharacterAdded:wait() local leader = player.leaderstats local stage = workspace:FindFirstChild(leader.Stage.Value) Character:MoveTo(stage.CFrame).p + Vector3.new(0,3,0) repeat local parts part:GetTouchingParts() if (parts == nil) then touching = false end until not touching end end)
Hope this works out for you, I also switched up a few things for efficiency, if so don’t forget to accept the answer and upvote! Good luck!