Hello, I am looking for some help on making a private server system for my game.
I have a custom UI made for it, I just don’t know how to script it or where to start.
This system will include:
-
Randomized Letter Join Code
-
Server Settings in the private server that allow you to regenerate the join code and change the server name, Make the server access listed or unlisted.
-
Join server by Code
-
List of all the private servers ( unless the access is unlisted in the server settings)
-
When you click on the server a UI shows the Server Name, The amount of players in the server, The server Join Code & Server owner
I know I have to have things like TeleportService and math.randomize & PromotProductPurchase. But other then that I have no idea what to do, Could somebody help me out with making this system? Thanks!
If someone creates a private server, call TeleportService:ReserveServer(game.PlaceId) to get the long code for the reserved server. Then, generate a unique short code for it, aiming for around 5 to 6 characters in length. Make sure the generated code doesn’t already exist. Once you have the short code, store all relevant information, including the user ID of the server creator, in a datastore. Create a server function called “joinServer” and make it accessible to the client using a RemoteFunction. In this function, try to fetch the server with the assigned short code. If found, get the long code and teleport the player to the server using this code.
Alright, now how would I do that?
Here is an simple example how you could do it:
PrivateServer.rbxl (61.7 KB)
1 Like
Might be a bit late to this however after testing out your script etc, How would go about publishing to certain servers. Like would it be possible to publish different things to different places.
1 Like