Yes, but :ReserveServer only returns a code for a reserved server. You have to use TeleportService | Roblox Creator Documentation to actually teleport the players though. Also the pages provide code samples for you.
i donât think you get what he means, he means he wants a reserved server like a free VIP of sorts.
anyways apologies for the energy I gave off, I assume you want it reserved so if you go onto the reserve page like you showed, you get the code such as this.
(note this is on the page)
local TS = game:GetService("TeleportService")
local Players = game:GetService("Players")
local code = TS:ReserveServer(game.PlaceId) -- Returns a code
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
Yes I am. And I do not mean kicking them. For example there is 10 Reserved Servers. New Player joins. New Server should be created for him since there is no normal Servers left.
I am going to explain you my situation so itâs clear what I need.
I wanted to make a GUI for admins where they close game for updates. Admin GUI fires a cross - server message. The message gets read on all game servers. These game servers (if they are old version servers) reserve their server (since nobody can join and nobody gets teleported onto the server), teleport all players on the server to the menu and after 15 seconds (if the server is still running) it kicks the players who left.
I just want to know a code for âreservingâ such a server (something like turning a game server a VIP but not owned by anybody).
I have already checked it out, thatâs not what I like to use since my game would use a custom made system (I can check out soft shutdownâs code if it does have anything for reserving server rather than just teleporting players who join).
What you need to do is:
Once the GUI button is clicked, you will need to use PublishAsync.
Then, in a ServerScript or something you will need to use SubscribeAsync. The pages above will tell you about everything you need to know about the functions.
You can run ReserveServer again to generate a new code so that other players wonât use the same Reserved Server Code and teleport to that same server.
What do you mean by this as I donât really understand (since I think that ReserveServer reserves a random, not current, game server returning a code that allows people to join that random server using returned code - of course done by scripts)?