How do you make it so that the player's max health is increased each time he levels up? Thanks!
local leaderstats = Instance.new("IntValue") local lv = Instance.new("IntValue",leaderstats) local exp = Instance.new("IntValue",leaderstats) local levelUp = {32, 64, 128, 256, 512, 1024, 2048} game.Players.PlayerAdded:connect(function(Player) lv.Name = "Lv" lv.Value = 1 exp.Name = "EXP" exp.Value = 0 leaderstats.Parent = Player leaderstats.Name = "leaderstats" exp.Changed:connect(function() if exp.Value >= levelUp[lv.Value]then exp.Value = exp.Value - levelUp[lv.Value] lv.Value = lv.Value + 1 Player.Character.Humanoid.MaxHealth = Player.Character.MaxHealth + 100 -- I tried this end end) end)
Do something like Multiply the Max health by the level that would work or if you want it less you could multiply the maxhealth by the level divided by 1.5