GetPropertyChangedSignal not firing

I have a realism system where if you take damage, your screen gets more gray and blurry. This used to work but… Suddenly it doesn’t recently? I never touched it plus there’s no errors being printed. Any help is appreciated. It also seems as if it isn’t even firing when I was trying to test this ever since it broke even though I was still changing my health. I know it didn’t fire because it never printed k.

character.Humanoid:GetPropertyChangedSignal("Health"):Connect(function()
    print("k") -- doesn't print, this is the first part of the function
-- not showing the rest, i don't like showing my scripts that much.
end)

Humanoids have their own .HealthChanged event. Test it out.

Still doesn’t work. Maybe ROBLOX did an update with this stuff?

Have you tried using :WaitForChild("Humanoid")?

Would I be able to see how you set the character variable and any code related to referencing the humanoid? Might make it a bit easier to find an answer to your problem.

1 Like

Isn’t there an error that comes with it?

Nope, no errors oddly. I don’t know whats the problem.

local character = game.Players.LocalPlayer.CharacterAdded:Wait()

local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")

Humanoid.HealthChanged:Connect(function(NewHealth)
	print("Health changed in \".HealthChanged\" to", NewHealth)
end)

Humanoid:GetPropertyChangedSignal("Health"):Connect(function()
	local NewHealth = Humanoid.Health
	print("Health changed in \":GetPropertyChangedSignal\" to", NewHealth)
end)

I put that in StarterCharacterScripts and it seemed to work, the only difference being :GetPropertyChangedSignal doesn’t seem to have a parameter with the new value.

1 Like

Did you change the kind of script you were using compared to when it was working? Like did you change it from a local script to a server script? The server wont detect a change you made with the client.

Try using WaitForChild

(30 Letters)

No, it’s in a localscript inside of StarterPlayerScripts.

local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

your code wouldn’t work if the character already existed, because then it would wait for you to respawn for it to work

Try moving the script to StarterCharacterScripts.

Just try it…

It will probably work

Well seems like no one read this lmao

2 Likes