GetPropertyChangedSignal ran before property is set for Health

Make a localscript containing the following code:

repeat wait( ) until game.Players.LocalPlayer and game.Players.LocalPlayer.Character
local Hum = game.Players.LocalPlayer.Character:WaitForChild( "Humanoid" )
Hum:GetPropertyChangedSignal( "Health" ):connect( function ( ) print( Hum.Health .. "/" .. Hum.MaxHealth ) end )

Next start playsolo and reset.

You’ll notice it prints your health as 100/100 even though you are dead. It should print 0/100 as your health is 0.

1 Like

Looks like the setters for this property actually fires the signal before setting the value O_o

You currently need to use the HealthChanged signal of Humanoid to detect changes in the Humanoids health, MaxHealth actually should work correctly though.

2 Likes

Ah my bad, forgot that it was just reading MaxHealth, not being triggered because of MaxHealth