How to Create a Limited Lives System using tables?

So me and my Development Crew are working on a game for fun. But we can’t seem to figure out a way to make a lives system like in deepwoken. I am creating this post to find a basis to work off of.

What exactly do you mean by “a lives system like in deepwoken”? Are you reffering to the 3 lives before getting wiped, the save slots, or something else?

upon damage subtract health from player (probably datastore it), upon death, multiply all items and stats by 0.5 + modifiers

The 3 lives, is exactly what I meant.

You can create a value called “lives” that’s value is the number of deaths you want to allow. Upon death you can subtract one from the value. When the player levels up you can add to that value if they aren’t already at maximum lives. Then you can use the property changed signal, or value.Changed to detect when the player’s deaths go up and down so you can apply effects like the rusty health bar in deepwoken and sending the player to the depths if they only have one life left.

That would work but I am trying to store the lives inside of a table not an Int or Number Value

Ahh my bad, I completely forgot about that. I’m not completely sure what you mean by “using a table” to do this, but here’s what I thought of:

Create a table called “playerLives” that keeps track of the number of lives for each player in the server. When a player joins insert them into the table with the value of the number of lives they have. Then whenever something happens, the player dies, levels up, etc, adjust their value in the table accordingly.

Let me know if this isn’t what you were looking for and please provide more information if possible!

why is it a table what else are you storing in it can’t it be a “Lives” key with the lives as value

It is easily exploitable depending on how you make it and tables our overall way more organized

Thank you, let me join studio and try it!