From cc7b8a75c8fa5e320e137f0146698887f2ab8915 Mon Sep 17 00:00:00 2001 From: DoopieWop <62191983+DoopieWop@users.noreply.github.com> Date: Thu, 18 May 2023 02:08:27 +0200 Subject: [PATCH] fixed pain sound hook called by all entities --- plugins/playerinjuries/sv_hooks.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/playerinjuries/sv_hooks.lua b/plugins/playerinjuries/sv_hooks.lua index 79d65fe3..0105da91 100644 --- a/plugins/playerinjuries/sv_hooks.lua +++ b/plugins/playerinjuries/sv_hooks.lua @@ -53,7 +53,7 @@ function PLUGIN:GetPlayerPainSound(client) end function PLUGIN:EntityTakeDamage(client, dmg) - if ((client.nutNextPain or 0) < CurTime() and client:Health() > 0) then + if (client:IsPlayer() and (client.nutNextPain or 0) < CurTime() and client:Health() > 0) then local painSound = hook.Run("GetPlayerPainSound", client, dmg) or PAIN_SOUNDS[math.random(#PAIN_SOUNDS)] if (client:isFemale() and !painSound:find("female")) then