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

How to teleport people to a Reserved Server?

Asked by 2 years ago
Edited 2 years ago

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

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

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'.

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 User#39520 0 — 2y
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. AProgrammR 398 — 2y
0
and also you cant teleport in studio AProgrammR 398 — 2y
0
It's not working, I edited my answer below so you can see whats happening User#39520 0 — 2y
View all comments (3 more)
0
make sure its in studio. idk what is happening then. AProgrammR 398 — 2y
0
also, i think it should be a script AProgrammR 398 — 2y
0
wait, noo sorry make sure its in-game not studio AProgrammR 398 — 2y
Ad
Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

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

0
check my comment in my answer. AProgrammR 398 — 2y

Answer this question