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)
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.
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.
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.