I Was Wondering How Do I Make If You Level Up And The Health And The Max Health Increases
This Is The Script
local player = game.Players.LocalPlayer
local level = player:WaitForChild("Level")
local current = level:WaitForChild("Current")
local max = level:WaitForChild("Max")
-- UI-related variables.
local gui = script.Parent
local exterior = gui:WaitForChild("Exterior")
local label = exterior:WaitForChild("Label")
local exp = exterior:WaitForChild("Exp")
local bar = exterior:WaitForChild("Bar")
-- Change stats upon join.
label.Text = "Level "..level.Value
exp.Text = current.Value.."/"..max.Value.." EXP"
bar.Size = UDim2.new(current.Value/max.Value, 0, 1, 0)
level.Changed:Connect(function(val)
label.Text = "Level "..level.Value
exp.Text = current.Value.."/"..max.Value.." EXP"
bar.Size = UDim2.new(current.Value/max.Value, 0, 1, 0)
game.Workspace["LevelUp"]:Play()
end)
current.Changed:Connect(function(val)
exp.Text = current.Value.."/"..max.Value.." EXP"
bar.Size = UDim2.new(current.Value/max.Value, 0, 1, 0)
end)
This Is The EXP Gui

And This Is The Health Gui

Please Let me Know-How
Make a server script and make it this
local MaxHealthRate = 50 -- how much the max health is upgraded per level
game.Players.PlayerAdded:Connect(function(Plr)
Plr.CharacterAdded:Connect(function(Char)
local Level = Plr:WaitForChild("Level")
local StartHum = Char:FindFirstChildWhichIsA("Humanoid") or Char:WaitForChild("Humanoid")
if StartHum then
StartHum.MaxHealth += MaxHealthRate
StartHum.Health = Hum.MaxHealth
end
Level.Changed:Connect(function()
local Hum = Char:FindFirstChildWhichIsA("Humanoid")
if Hum then
Hum.MaxHealth += MaxHealthRate
Hum.Health = StartHum.MaxHealth
end
end)
end)
end)
Are You Sure?
It’s Gonna Give Me A Warning
Can you show the full code? That isn’t really helpful. Also those things are really misleading sometimes. Just test it out
@piratehammer
It Gave Me A Error

I Thought It Was A Warning
Can you show the code plz. Plz
Change the Hum to StartHum. That’ll fix it
The Health Starts With 100 Not 150

Change it to this
local MaxHealthRate = 50 -- how much the max health is upgraded per level
game.Players.PlayerAdded:Connect(function(Plr)
Plr.CharacterAdded:Connect(function(Char)
local Level = Plr:WaitForChild("Level")
local StartHum = Char:FindFirstChildWhichIsA("Humanoid") or Char:WaitForChild("Humanoid")
if StartHum and Level.Value > 1 then
StartHum.MaxHealth += MaxHealthRate * Level.Value
StartHum.Health = Hum.MaxHealth
end
Level.Changed:Connect(function()
local Hum = Char:FindFirstChildWhichIsA("Humanoid")
if Hum then
Hum.MaxHealth += MaxHealthRate
Hum.Health = StartHum.MaxHealth
end
end)
end)
end)
@piratehammer