So the problem is the script first runs (wait 23 seconds) then the Function is active and listening and whenever a player touches the part they will get tped and the Function should also stack after each 23 seconds like it will try to teleport them to there 2 Times which is inefficient.
The Explanation is inside the code.
01 | local TeleportService = game:GetService( "TeleportService" ) |
02 | local gameID = 6446611098 |
08 | local function statushandler(player) |
09 | for _, queueplayer in pairs (queue) do |
10 | if queueplayer = = player then |
13 | table.insert(queue,player) |
20 | for _, player in pairs (queue) do |
21 | local plr = game:GetService( "Players" ):FindFirstChild(player) |
23 | TeleportService:Teleport(gameID, player) |
29 | local function onTouched(hit) |
30 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
32 | statushandler(player.Name) |
36 | script.Parent.Touched:Connect(onTouched) |