Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I limit how many players can teleport to a certain place at a time?

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!

3 comments

0

Please put your code in code blocks

0

if 2 "humanoid" touch = cooldown 120 second

0

Thanks, and sorry about not putting code into code blocks.

1 answer

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.