Using GetPropertyChangedSignal on the humanoid is not working?

Edit: Nevermind, it wasn’t committing my script changes for some reason, it works

hello, I have this script

local target = script.Parent.Parent
local humanoid = target:FindFirstChild("Humanoid")

print(humanoid.Parent.Name)

humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function()
	
	print("Speed change detected")
	local debuffActive = humanoid:FindFirstChild("HitByCannon")
	
	if debuffActive and humanoid.WalkSpeed > 4 then 
		
		if debuffActive.Value == true then
			humanoid.WalkSpeed = 4	
			print("Speed changed")
		end
		
	end
	
end)

The only thing that gets printed is the name of the player, but none of the things in the function ever print, even when the humanoid speed is changed. I am fairly sure I have written it correctly. Is this the correct way to check for walkspeed changes when the humanoid is under a debuff? Thanks

Make sure you are setting the walkspeed in a script if this is a script. Otherwise the script won’t detect the change.

Make sure your script isn’t a server script as clients changing their speeds won’t be replicated to the server.