ok, so im making a custom gui health bar and i have made it so it hides the normal health bar and instead whenever the health changes, so when you heal or take damage, it updates like the normal health bar since the new health bar looks disgusting.
Although on doing this using the GetPropertyChangedSignal()
on the health bar when it takes damage it acts normal, but on healing it doesn’t, and it just shows blank. Here is the video of this happening:
And here is my code:
local StarterGUI = game:GetService("StarterGui")
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:FindFirstChild("Humanoid")
local text = script.Parent
StarterGUI:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
humanoid:GetPropertyChangedSignal("Health"):Connect(function()
print(humanoid.Health)
if humanoid.Health ~= 100 then
text.Text = "Health: " ..tostring(humanoid.Health)
else
text.Text = "Health: 100"
end
end)
I’m Unsure if this is the case although it says that GetPropertyChangedSignal()
only updates for bools, ints and strings and looking at the print statements it clearly shows while healing it makes the health a float (a number with decimals) and i’m wondering if thats doing something but then the print statement is in the GetPropertyChangedSignal()
? Im Quite Confused On Why This Is Happening