Giving A player their own Prison cell

Assigned prison cells

  1. When A player joins the game and they select the “prisoner” team they will be randomly assigned a cell and when they die they will always respawn in that cell.

  2. I know this is done in many games like Jailbreak, Madcity, Bloxburg, ect… But how can this be done?

  3. What I have thought to do so far is when the player joint the prisoner team a script will pick a random number (1-10 for example) and then check if the spawn is still available and if so it will assign that player to that team spawn and then mark that spawn as taken. When all the spawns are taken the game will mark the team as full.

Later after this works I am thinking of letting the prisoners customize their assigned cells, this will also save and load when the player leaves and rejoins the game/team. It will always reset to default when the cell is unoccupied.

3 Likes

Although, there’s multiple possible approaches to this I’d track the data of whether a prison is “unclaimed” or “claimed” in a table, that’s all there is to it.

I would just straight up remove claimed cells from the table, and add them back when they become available again.

1 Like

ok so that is to keep track of when a cell is taken, what about letting them customize their cell and then having that load ect…

I would use ProfileService and create a Profile containing the user’s saved cell customization data, then load it in when they rejoin.
You could also use Attributes if you wanted to.

1 Like