So I'm trying to make this health bar that show the health of a player and the bar lowers however a player lose health but it isn't working.
I have a screengui into Playergui named Health, an ImageLabel named BackRound inside Health , another ImageLabel named Bar inside BackRound, and this script inside Bar
Hp = script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health
x = script.Parent
print("Running")
function Change()
x.Size = UDim2.new(Hp.Value /100, 0, 1, 0)
if Hp.Value < 0 then
Hp.Value = 0
elseif Hp.Value > 100 then
Hp.Value = 0
end
end
Hp.Changed:connect(Change)

1 comment
Thanks this really helped !