How'd I go about making a Number value stored inside a player's character save in a datastore and not reset when a player's character dies

Simply, I want A) Whenever a player’s character dies, a Number Value inside the player’s character resets, Instead I want it to stay the same value when the Character Spawns because another script is dependent on checking it to call a function whenever the play’s character loads.

and B) I want said value inside a player’s character to save into a datastore when they leave and when they join. (Or Even an AutoSave System)

Thanks in advance!

You should just store it in the Player.

store inside player object instead

i mean i guess but it would be a bit harder for the script to work but its a solution

would a datastore work with the value inside player because it doesnt for character

1 Like

I don’t think saving data to a data store is related to where the data is coming from, so it should work either way.

If you need the value in the character, store it in the player and copy it to the character when they spawn.