I have already made a leveling system and now i want to make max health equal to level * 100. What did i do wrong in this script?
local LVL = Player.LevelingSystem.Lvl LVL > 0 while true do Player.Character.Humanoid.Maxhealth = LVL * 100 end
Assuming LVL
is an instance, we can use .Changed property.
The script HAS to be LOCAL.
local Player = game.Players.LocalPlayer --get the local player local LVL = Player.LevelingSystem.Lvl --get the level LVL.Changed:Connect(function() --when it is changed, update the health Player.Character.Humanoid.MaxHealth = LVL.Value * 100 Player.Character.Humanoid.Health = Player.Character.Humanoid.MaxHealth --optional end)
This will update each time the value is changed.