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

How to create a "game teleport" like in the game "camping"?

so, im creating a game that is "not quite" like camping, but the joining process is very similar, but im not sure how to get a group of players to join the server of the ACTUAL game, and after that make sure to not teleport anymore players to that groups server...

i know there is a way to do it with the whole "reserve server" thingy, but obviously by the name i just called it by, i don't know how to work it..

if someone could create a game teleport like so, that would be fantastic.

2 answers

You want to teleport a group of players to a reserved server private server.

local TS = game:GetService("TeleportService")
local Players = game:GetService("Players")
 
local code = TS:ReserveServer(game.PlaceId) -- Reserves the server
local players = Players:GetPlayers() -- Get a list of all players
 
TS:TeleportToPrivateServer(game.PlaceId, code, players) -- Actually teleport the players
-- You could add extra arguments to this function: spawnName, teleportData and customLoadingScreen

Instead of all the players you will only want some players. For that just do this: local playersTable = {} and to add a player just do: table.insert(playersTable, plr)

If this helped you out, please mark it as the answer. To clear the table; aka make it empty you will just do local playersTable = {} again.

3 comments

0

this should work, but now i need to make brick that counts the amount of people inside it, and once it gets to four players, then it teleports that group

0

if anyone has any idea how to make it work, please respond, im still tryina figure it out myself... wish i could just get the creator's of those games to message me somehow

1

add the player to a table when he touches the brick, and once #table == requiredPlayers teleport them. accept it as the answer please

I believe it uses the universes. It allows you to have multiple places under 1 game. Take a look at Roblox's Wiki article https://developer.roblox.com/en-us/articles/Teleporting-Between-Places

Roblox also has another tutorial on reserving servers here

If you couldn't understand the Wiki links I gave you, feel free to respond!

2 comments

0

I mean like from the lobby of the game, to the actual game, but only in groups, and then anyplayers who join the game after that will be teleported to a new server, so that the game will always have one server per group, and no one else can join that groups server

0

I think as long as you have your start place set to the lobby place, no other player can join unless teleported. @kaspar1230 shows you how to group players together by using arrays. (Line 5 to 7)

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