I'm attempting to make a GUI that displays the amount of lives the player has. Each time they die they are supposed to lose a life. I placed into the Workspace a local script with the following code.
local player = game.Players.LocalPlayer
G_lives = 3;
if (player.health == 0) then
G_lives = G_lives - 1
print(G_lives)
end
I'm getting no output from this though, and I'm not exactly sure why. Could anyone explain the flaw in my code?

1 comment
The health isnt in the player, its in the Character or the Character's humanoid. This means you have to go player.Character.Humanoid.Health or player.Character.Health