I need help with a health billboard gui ?
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 ?
01 | game.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 |