-
What do you want to achieve?
I want to make the player’s health appear above their Head. -
What is the issue?
The script always returns 100, not 99-1, but does return 0 -
What solutions have you tried so far?
I have tried:
I. Getting the Player’s Health from a variable.
II. Getting the Player’s Health from script.Parent:WaitForChild(“Humanoid”)
Code:
local health = script.Parent:WaitForChild("Humanoid").Health -- This variable is
-- in a loop so it should be updating, but it only updates when the player has
-- 100 or 0 health.
print(health) -- This is returning only 100 or 0 for some reason.
newgui.GreenBar.Size = UDim2.new(0, health, 0, 10) -- Health bar frame, only
-- updates if the Player's Health is at 100 or 0.
Any help would be greatly appreciated.