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

Teleporting only 10 players to a server?

Asked by 4 years ago

Hey guys :) I came up with an idea for a pretty nice Roblox game but im very new at roblox studio and scripting. Currently i’m trying to figure out how to teleport 10 players only. Imagine there’s a plate and it only starts to teleport if 10 player are standing on it. And it should not teleport if there are 9 or 11 players on it.

These 10 player should be teleported to a server where they can choose teams and play against the enemy teams. That means that if another group of 10 players gets teleported they should be teleported to another server.

I really hope yall understand what i mean :/

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
local place = 1234567 -- Your place id here
for i,v in pairs(game.Players:GetPlayers()) do
    if i ~= 10 then
        local tp = game:GetService("TeleportService")
        tp:Teleport(place, v)
    end
end
0
thank you :) i will try it out! i’m not sure if i understand the script correctly but why did it say tp:Teleport (placeid, v) and not tp:Teleport (place, v)? yuurisana 0 — 4y
0
so i tried it and it doesn’t work :( yuurisana 0 — 4y
0
I believe that you have to either rename "place" to "placeid" or change "placeid" to "place" appxritixn 2235 — 4y
0
i tried it already and it didn’t work either yuurisana 0 — 4y
0
oh, sorry, my mistake. DilanALX12345678901 7 — 4y
Ad

Answer this question