Just so you know before trying, ReserveServer doesn't work in Studio. So make sure to playtest in Roblox Player.
Also, make sure that the place you're reserving a server for is inside the same game as the place which is reserving a server.
It might work on places outside the game of the place which is reserving a server, but I am not sure.
I am assuming you're having trouble teleporting several people to a reserved server, not with making a reserved server. If I am wrong please reply to this to let me know.
To teleport several people to a reserved server, there's a thing you can use called tables.
Explaning how it works fully would take too long, so if you want to learn check this out: https://developer.roblox.com/en-us/articles/Table
To add a player to your table, you use the table.insert command.
Here's a quick showcase on how it could work if I was in the server where the script is running:
local players = {}
table.insert(players, game.Players.EmK530)
print(players[1].Name)
To teleport players correctly using tables, you have to add the instance of the player. Which I basically did in the example script, but I'm assuming you have a functioning script which can add all the players into the group table.
Now, once we have our fully functional table, we can teleport all players like the script below.
(this table I am making here won't work with yours, you know what to do, this is just an example!)
local players = {}
table.insert(players, game.Players.EmK530)
local TS = game:GetService("TeleportService")
local code = TS:ReserveServer(0000000)
TS:TeleportToPrivateServer(0000000, code, players)
If anything goes wrong, let me know. Glad I could help!
2 comments
Do you mean you would want to actually make a server? I dont think you can make them, but you can teleport players to different servers.
No i mean it creates a server where only the teleported players can join and the server locks after they joined like dungeon quest