How do i make a "forver" server in my game?

What i mean is lets say in a game, you place a block down. Eventually that server dies, and has 0 players.
I dont want the server to close then, i just want that server to be “closed” untill a new player joins.
Similar to minecraft, you dont loose all your progress as soon as a server dies, it stays no matter what

Is this possible?

2 Likes

Use a datastore for the players progress
Also, you didnt really elaborate fully, like if your talking about minecraft, is it like saving buildings?

1 Like

im not talking about when a player join, it loads their build data.
i mean player1 makes something then leaves, the build stays and another player can see it just like in minecraft. When you join a minecraft server your build does not just load in, it stays there without you there

1 Like

I think you have to use BindToClose() and ReserveServer() but I dont know.

1 Like

are you making something akin to minecraft realms? like each player could create their own private server?

in that case you should probably be using datastores for that

otherwise if you’re trying to make a game that all servers share a world, then you should be using a combination of datastores and memorystores

I don’t think this exact type of persistence is possible on Roblox. A server will always close if it’s empty as far as I know. You can however reserve servers and generate unique IDs for them. A reserved servers ID will always exist even if the server itself has gone inactive. You could create a set of reserved servers and load the state of each server when a player joins.

1 Like

Im not making a game like this, im really just curious. Thanks!

1 Like

What you do is save builds to a DataStore that represents the server data instead of player data.

Then when the server loads up for the first time, you load in all the builds.

You can’t keep a physical server running forever, but this is how you have a minecraft-like system where builds persist regardless of player.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.