How do I fix this Health Script on Evercyan Rpg kit

So I was making a Undertae Rpg Game and when my friend did this reset leaderstats thing it works but then when I start up the game or rejoin the game it says that I am at 100/100 Hp and I didn’t know why it wasn’t working, it keeps doing everytime I play the game or test the game but when go to armor but my friend will fix the hair part but when I go to the armor it puts me to the hp it puts me at like if it say 50 hp it gives me 150 hp but when I go in it again it gives me the level that it was suppose to be on the hp here a video of it and script https://gyazo.com/96f267b4f792b5a16f404ac3b0d23d65

local LevelUp = function(plr, Level, XP)
if XP.Value >= Level.Value * 25 then
– Leveling
XP.Value = XP.Value - Level.Value * 25
Level.Value = Level.Value + 1
local LevelUpNotify = Instance.new(“Hint”)
LevelUpNotify.Parent = workspace
LevelUpNotify.Name = “LevelUpNotification”
LevelUpNotify.Text = plr.Name … " has leveled up!"
game.Debris:AddItem(LevelUpNotify,1)
– Health
if (not plr.Character) then return end
local hum = plr.Character:WaitForChild(“Humanoid”)
hum.MaxHealth = hum.MaxHealth + 10
– Fireworks
if (not plr.Character) and (not plr.Character.Head) then return end
local head = plr.Character.Head
wait()
for i = 1,5 do
local fireworks = Instance.new(“Part”)
fireworks.Shape = Enum.PartType.Ball
fireworks.Material = Enum.Material.Metal
fireworks.Transparency = 1
fireworks.Size = Vector3.new(0,0,0)
fireworks.BrickColor = BrickColor.Random()
fireworks.CFrame = head.CFrame + Vector3.new(90,90,90)
fireworks.Parent = workspace:FindFirstChild(“DebrisHolder”)
local pick = math.random(-25,25)
fireworks.Velocity = Vector3.new(math.random(-25,25),math.random(-25,25),math.random(-25,25))
game.Debris:AddItem(fireworks,2)
end
end
end

game.Players.PlayerAdded:Connect(function(plr)

plr.CharacterAdded:Connect(function(chr)
	local hum = chr:WaitForChild("Humanoid",10)
	local leaderstats = plr:WaitForChild("leaderstats")
	local Level = leaderstats:WaitForChild("Level")
	repeat wait() until plr:FindFirstChild("DataLoaded")~=nil
	hum.MaxHealth = Level.Value * 10 + 100
	hum.Health = hum.MaxHealth
end)

local leaderstats = plr:WaitForChild("leaderstats")
local Level = leaderstats:WaitForChild("Level")
local XP = leaderstats:WaitForChild("XP")

Level.Changed:Connect(function() wait() LevelUp(plr, Level, XP) end)
XP.Changed:Connect(function() wait() LevelUp(plr, Level, XP) end)

end)

This might be the script it maybe be doing right now but I am not sure

1 Like