Can someone tell me why my healthbar is not working

https://gyazo.com/b994e70dd6d961977022d5f356ae12b0
https://gyazo.com/52fc8535350c27acf8d14d261db5bb73
https://gyazo.com/12a2c5fcdde92f919a9557e9aa59156c

Watch these in order

2 Likes

Where is the LocalScript located in the first video?

First of all, you’re cloning the healthbar in a LocalScript, causing other players being unable to see the bar.

The main problem is you are not changing the size of the cloned gui, but the gui in ReplicatedStorage, the one you cloned.

Head.HealthBar.Remaining.Size ...

It is in Starter player scripts

Instead, put the gui in StarterCharacterScripts and insert this localscript as a child:

while task.wait() do
    local hp = script.Parent.Parent:WaitForChild("Humanoid").Health
    script.Parent.Remaining.Size = UDim2.fromScale(hp / script.Parent.Parent.Humanoid.MaxHealth, 1)
end
1 Like

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