So I'm making a game, and I want to limit how many players can touch a block and teleport at a time. Here is the teleport script:
function onTouch(part) if part.Parent.Humanoid ~=nil then part.Parent:MoveTo(script.Parent.Parent.Tele2.Position) script.Parent.Parent.Tele2.Script.Disabled = true wait(0) script.Parent.Parent.Tele2.Script.Disabled = false end end script.Parent.Touched:connect(onTouch)
Is there anything I could add to it so only 2 people can teleport within 2 minutes or so? And maybe have an error message when a player tries to teleport when 2 people already teleported within the 2 minutes? Thanks!
if 2 "humanoid/player" touch = cooldown 120 seconds if cooldown now = -120 seconds = text.message "insert (i recommend "please wait 2 minutes/cooldown)" if not search on yt