Mana Bar Not Displaying Number

Mana Bar Isn’t Showing Number Of Mana The Character Has.

Here is the Script in GUI

local bar = script.Parent.ManaFront
local manaText = script.Parent.ManaText  -- Assuming you have a TextLabel named ManaText

local char = game.Players.LocalPlayer.Character
local hum = char:WaitForChild("Humanoid")

local maxMana = hum:WaitForChild("MaxMana")
local mana = hum:WaitForChild("Mana")

local function updateManaDisplay()
	local change = mana.Value / maxMana.Value
	bar:TweenSize(UDim2.new(change, 0, 1, 0))
	manaText.Text = tostring(mana.Value) .. " / " .. tostring(maxMana.Value)
end

mana.Changed:Connect(updateManaDisplay)
maxMana.Changed:Connect(updateManaDisplay)

-- Initialize display
updateManaDisplay()
2 Likes

What do you mean “isn’t showing”? Is there an error, or is the text blank?

You’re not using this function correctly. But instead of me explaining this function, you should consider TweenService instead! It can tween all instance properties that are interpolatable, like numbers.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.