Roblox Incapacitation system not working

Hello there the users of devforum. I’ve created this script where it detects if a player has taken damage but sadly it doesn’t work as it doesn’t print. It doess not display an error aswell. Keep in mind this is my first time using remote events.

local function TookDamage(player)
	player.CharacterAdded:Connect(function()
		if player.Character then
			
			local humanoid = player.Character.Humanoid
			
			humanoid.HealthChanged:Connect(function()
				if humanoid.Health <= 80 then
					print("Player Incapacitated")
				end
			end)
		end
	end)
end

remoteEvent.OnServerEvent:Connect(TookDamage)
1 Like

can you show the code where the remote event fires?. have you also tried making a print like
local function TookDamage(player)
→ print(“test”)
player.CharacterAdded:Connect(function()
if player.Character then

we can see if its the remote event or the functions fault.