Hello, I am new to scripting and would like to know how to make teleport pads only teleport once. So if you stand on a teleport pad,you won't teleport back and forth.
local Teleport = "Lentilkac58-Easy-Teleport-2"
function Touch(hit)
if script.Parent.Locked == false and script.Parent.Parent:findFirstChild(Teleport).Locked == false then script.Parent.Locked = true script.Parent.Parent:findFirstChild(Teleport).Locked = true
local Pos = script.Parent.Parent:findFirstChild(Teleport)
hit.Parent:moveTo(Pos.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false end end
script.Parent.Touched:connect(Touch)

2 comments
It's called a debounce.
^