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

How to teleport people to a Reserved Server?

So I know one game can have multiple places so I was wondering how to teleport multiple people who were in a game queue into their own server that will stop other people from joining once they are all loaded in

2 answers

You can use a reserve server.

local TS = game:GetService("TeleportService")
 
local code = TS:ReserveServer(placeid here) 
 
TS:TeleportToPrivateServer(placeid here, code , player / player table) 

It can only be accessed by the 'code'.

7 comments

0

I'm a little confused, I put place id in all the places it said to, and then I just put random numbers for the code, and then I put stoutscientist as player but it didn't teleport me. I assume this is user error

0

you don't need random numbers for the code. There is the var 'code' and there is the method reserveserver which already returns a code. Just leave the 'code' like that.

0

and also you cant teleport in studio

0

It's not working, I edited my answer below so you can see whats happening

0

make sure its in studio. idk what is happening then.

0

also, i think it should be a script

0

wait, noo sorry make sure its in-game not studio

EDIT: So this is what I did:

game.Players.PlayerAdded:Connect(function(player)
	local TS = game:GetService("TeleportService")

	local code = TS:ReserveServer(8357468682) 

	TS:TeleportToPrivateServer(8357468682,code,player) 
end)

But it doesn't work. I don't know what I'm doing wrong, does it need to be a local script? Right now it's a normal script in the workspace folder so I don't know if it needs to be in ServerScriptService or what

1 comment

0

check my comment in my answer.

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