I might've asked this before but I don't know on how to make a data store for health. All I know is making data stores that are associated to leaderstats such as cash and level. I looked up online and even here but I can't seem to find anything about them that work. So here's the save data:
function savedata(dataname, playerid, value)
if InStudio then return end
dataname:SetAsync(playerid, value)
end
And I decided to add a starting health for the player:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
char.Humanoid.MaxHealth = 250 --Starting Health
player.Character.Humanoid.Health = player.Character.Humanoid.MaxHealth --Sets player health to max
end)
end)
And Health change when player levels up
player.Character.Humanoid.MaxHealth = levelz.Value * 50 + 250 --Change 100 to the health value
player.Character.Humanoid.Health = player.Character.Humanoid.MaxHealth --Sets player health to max

2 comments
They don't have to be for saving leaderstats, but data stores can be used to do so. Simply save their health like you would save anything else
But how do I make a data store for health. Like do I make Humanoid.MaxHealth or something?