Because when I restart, my life is not saved?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want it to be based on a points system that when you level up, you have points in which I raise the defense in the video and when I exit the game and re-enter my life is reset to 100/100 causing it to change again raising the defense to the one he had in the points.
  2. What is the issue? Include screenshots / videos if possible!
    image
    image
    Here are the points that I have
    image
    These are the data values ​​that have to add to my life in this case 100 + 135.

https://i.gyazo.com/05e28942192160965588bde0d2060cb5.mp4
And here is the video where I teach it best

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried to take the data of my level and add it with the defense value which has not worked and I can not think of more ideas since I am a beginner in this and I took it from a tutorial

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

  Character = game:GetService("Players").LocalPlayer.Character
if not Character then repeat wait() until Character end

while wait() do
	script.Parent.Text = math.floor(Character:WaitForChild("Humanoid").Health) .."/".. math.floor(Character:WaitForChild("Humanoid").MaxHealth)
end

This is a local script where the text of health is located in the gui

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		local Data = player.Data
		local Defense = Data:WaitForChild("Defense")
		character.Humanoid.MaxHealth = Defense.Value + 100
		character.Humanoid.Health = character.Humanoid.MaxHealth + 100
		
	end)
end)

And this is the script where the maximum life is stored, that is, 100 / ā€œ100ā€ which is in quotes. This script is located in scriptservice

Try maybe setting the ā€˜ResetOnSpawn’ property on the ScreenGui off. That may fix it.

1 Like

Look, you think that in blox fruits your life has improved to 1500 but then when you exit the game and enter the life is reset to 100

my only way for it to work is for my player to die

I’m a little confused on what you are asking. Is it A: You want stats to be saved past deaths in-game OR B: You want stats to be saved past leaving and joining?

Wait, I think you should use DataStores. I’m not sure if your using it tho

That’s what i was going to suggest if he wanted saving between joins, but i can’t tell if its that or he wants data to be saved after someone dies, since GUI’s usually reset unless you have that Property you mentioned earlier off.

Oops: I said On earlier

Also, make sure ResetOnSpawn is off, you can find it in the ScreenGui.

I have datastores but If I not active resetonspawn dont work

Wait, what dosen’t work? The datastore or something else…?

el resetonspawn es lo que no funciona lo estoy diciendo

Oh, okay. Entonces no estoy seguro. Yo no uso DataStores, so yo no puedo decir que pasa

The B is that what you said… and A that work good