AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Roblox developer has shut down all servers12/23/2023 ![]() ![]() Never used TeleportService before so it might not be right, but looking at the documentation it should be, I’ll link the functions mentioned if needed: TPS:TeleportToPrivateServer(placeId, reservedServer, PS:GetPlayers()) ![]() Local reservedServer = TPS:ReserveServer(placeId) Local TPS = game:GetService("TeleportService") ![]() The code for this would be something like: local PS = game:GetService("Players") Instead of using :Kick() on the player, we would use :ReserveServer(placeId) to give ourselves an access code so that we can use :TeleportToPrivateServer() to teleport all players to that particular server. If is right and the use case for this is for an update to a game, to have the players not ‘leave’ the game so they’re still playing you can do as he says, the code for this wouldn’t have to be changed much from my original post. Something like this, you would call ShutdownServer wherever you want the eventuality for the server to be shut down, the better option would have been something called :Shutdown() which is a part of the ‘DataModel’ instance but sadly you can only execute the function in the command line. Player:Kick("No future player can join the server!") ![]() A usage and code example of this would be: local PS = game:GetService("Players") Add it to a connected function to the PlayerAdded event, if the boolean is true, kick the player. Has the right idea, but as mentioned, there could be an instance where you run this code and a player joins at the right time, hence the server you wanted to shut down wouldn’t be.Ī way around this that I would do is have a boolean which is set to true when you no longer want players joining the game. ![]()
0 Comments
Read More
Leave a Reply. |