--[[ | This file was obtained through the combined efforts | of Madbluntz & Plymouth Antiquarian Society. | | Credits: lifestorm, Gregory Wayne Rossel JR., | Maloy, DrPepper10 @ RIP, Atle! | | Visit for more: https://plymouth.thetwilightzone.ru/ --]] AddCSLuaFile("shared.lua") include('shared.lua') /*----------------------------------------------- *** Copyright (c) 2012-2023 by DrVrej, All rights reserved. *** No parts of this code or any of its contents may be reproduced, copied, modified or adapted, without the prior written consent of the author, unless otherwise indicated for stand-alone materials. -----------------------------------------------*/ ENT.Model = {"models/vj_hlr/hl2b/elitepolice.mdl"} -- The game will pick a random model from the table when the SNPC is spawned | Add as many as you want ENT.StartHealth = 60 ENT.GeneralSoundPitch1 = 80 ENT.GeneralSoundPitch2 = 80 --------------------------------------------------------------------------------------------------------------------------------------------- function ENT:CustomOnTakeDamage_BeforeDamage(dmginfo, hitgroup) if dmginfo:IsBulletDamage() then if self.HasSounds == true && self.HasImpactSounds == true then VJ_EmitSound(self, "vj_impact_metal/bullet_metal/metalsolid"..math.random(1,10)..".wav", 70) end if math.random(1, 3) == 1 then dmginfo:ScaleDamage(0.50) local spark = ents.Create("env_spark") spark:SetKeyValue("Magnitude","1") spark:SetKeyValue("Spark Trail Length","1") spark:SetPos(dmginfo:GetDamagePosition()) spark:SetAngles(self:GetAngles()) spark:SetParent(self) spark:Spawn() spark:Activate() spark:Fire("StartSpark", "", 0) spark:Fire("StopSpark", "", 0.001) self:DeleteOnRemove(spark) else dmginfo:ScaleDamage(0.80) end end end