Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help with a health billboard gui ?

Asked by 4 years ago

So the script below was supposed to lower the hpBar when the player takes damage, i used print to see if that part even runs when i change the hp of the hum, but it does not run at all, what is the error ?

01game.Players.PlayerAdded:Connect(function(player)
02    player.CharacterAdded:Connect(function(character)
03        local HPBar = game.ServerStorage:WaitForChild("BillboardGui").RedBar.Bar
04        local hum = character:WaitForChild("Humanoid")
05        local clone = game.ServerStorage:WaitForChild("BillboardGui"):Clone()
06        clone.Parent = character.Head
07        hum:GetPropertyChangedSignal("Health"):Connect(function()
08            local hp = hum.Health/hum.MaxHealth
09            print("ya mother")
10        end)
11    end)
12end)

Answer this question