KioFoxx

RemoveZombieHeadcrabs

Jun 15th, 2014
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. -- Have a Garrysmod Zombie RP? Hate the headcrabs? Well then this is for you...
  2. if ( SERVER ) then
  3.     local function RemoveCrabs()
  4.         for _, npc in pairs( ents.FindByClass( "npc_*" ) ) do
  5.             if npc:IsNPC() then
  6.                 if string.find(string.lower(npc:GetClass()),"npc_headcrab") then
  7.                     SafeRemoveEntity( npc )
  8.                 elseif string.find(string.lower(npc:GetClass()),"zombie") || string.lower(npc:GetClass()) == "npc_zombine" then
  9.                     npc:Fire("setbodygroup","0")
  10.                 end
  11.             end
  12.         end
  13.     end
  14.     hook.Add( "Think", "No_Crabs", RemoveCrabs )
  15. end
Advertisement
Add Comment
Please, Sign In to add comment