I have a script which when you level up your maxhealth increases by +4 and on join your maxhealth is changed to whatever your level is*4 but it doesn’t automatically give you the health that you should have which is for example if you are level 50 then your max health would be 300/300 but upon join it is 300/100
This is my script
while wait() do
script.Parent.Humanoid.MaxHealth = 100 + (game.Players[script.Parent.Name].leaderstats.LV.Value * 4)
end
if script.Parent.Humanoid.MaxHealth ~= script.Parent.Humanoid.Health then
script.Parent.Humanoid.Health = script.Parent.Humanoid.MaxHealth
end
The bottom part should only run twice when the player joins but it doesn’t help would be appreciated on why it doesn’t