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.

3 comments
Check out this great Roblox Wiki article: https://developer.roblox.com/articles/Debounce
Thank you!
I tested it out and it works, the table only has one value in it. Thank you so much.