So I'm trying to make a script to where a player's max heath is increased by a leaderstat. For example, if a player was level 20, their heath would be 120. But the script I made isn't working. Here is the script :
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(chr)
local hum = chr:WaitForChild("Humanoid",)
local leaderstats = plr:WaitForChild("leaderstats")
local Kaze = leaderstats:WaitForChild("Kaze")
repeat wait() until plr:FindFirstChild("DataLoaded")~=nil
hum.MaxHealth = Kaze.Value +100
hum.Health = hum.MaxHealth
end)
end)
Please help me out.
