I'm currently working on a teleporter [like the one in flood escape] for a racing game. Where when you touch the invisible barrier it puts you inside the teleporter then adds your name in an array so the script can teleport you when the race starts. The problem is when the player touches I have it print ("Touch"), so in the output it prints: Touch(x30). I've tried a couple if statements so it will only fire touch once but nothing seems to work.
Heres the code:
Pa = {} script.Parent.Touched:connect(function(part) print("Touch") local humanoid = part.Parent:FindFirstChild("Humanoid") if humanoid then table.insert(Pa, part.Parent.Name) local root = part.Parent:FindFirstChild("HumanoidRootPart") root.CFrame = script.Parent.Parent.Parent.MovingParts.Platform.CFrame + Vector3.new(0,5,0) wait() end end)
Any idea's would be greatly appreciated.
Use a debounce, basically what it is, is just like a cooldown, set a boolean value called DB and make it false and when the touch event gets triggered, make an if statement seeing if DB == false then
and then do DB = true