wait(1)
local Mana = game.Players.LocalPlayer.Data:WaitForChild("BarStamina")
local MaxMana = game.Players.LocalPlayer.Data:WaitForChild("MaxStamina")
local hpText = script.Parent.Parent.Stamina
Mana.Changed:Connect(function()
Mana.Value = math.clamp(Mana.Value,0,MaxMana.Value)
local change = Mana.Value / (MaxMana.Value)
script.Parent.Bar:TweenSize(UDim2.new(change, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2)
hpText.Text = math.round(Mana.Value) .. "/" .. MaxMana.Value
end)
1 Like
Ok thanks it works I think I understand