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

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

Asked by 4 years ago

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

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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.

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 dominicjj54321 8 — 4y
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 dominicjj54321 8 — 4y
1
add the player to a table when he touches the brick, and once #table == requiredPlayers teleport them. accept it as the answer please kaspar1230 345 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

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!

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 dominicjj54321 8 — 4y
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) singularvortex01 0 — 4y

Answer this question