Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

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!

0
Please put your code in code blocks Cynical_Innovation 595 — 3y
0
if 2 "humanoid" touch = cooldown 120 second moeck2 7 — 3y
0
Thanks, and sorry about not putting code into code blocks. SylvanPlayz 2 — 3y

1 answer

Log in to vote
-2
Answered by
moeck2 7
3 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

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

Ad

Answer this question