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

Teleporting only 10 players to a server?

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

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

5 comments

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)?

0

so i tried it and it doesn’t work :(

0

I believe that you have to either rename "place" to "placeid" or change "placeid" to "place"

0

i tried it already and it didn’t work either

0

oh, sorry, my mistake.

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