local bird_Damage_Radius = 1; -- the distance from the center of a bird that you can get hurt local bird_Damage_Dealt = 1; -- how much damage the bird does PER FRAME to a player it's near -- function called when a player is found in the birds sphere function birdDamagePlayer(bird, player) -- deal (bird_Damage_Dealt) to the player, by the bird. -- TakeDamage( amountOfDamage, whatHurtThem, whatWeaponHurtThem ) player:TakeDamage( bird_Damage_Dealt, bird, nil ); -- adding nil as the third parameter MAY be wrong -- but birds dont have weapons end function checkBirds() local allBirds = ents.FindByClass("npc_seagull"); -- get all the npc_birds in the map for count,bird in pairs(allBirds) do -- get all the entities near the bird local entsInBirdSphere = ents.FindInSphere(bird:GetPos(), -- the sphere center is on the bird bird_Damage_Radius); -- the radius for count2, entity in pairs(entsInBirdSphere) do if(entity.IsPlayer()) then birdDamagePlayer( bird, entity ); -- pass it on to our damage function end end end local allBirds = ents.FindByClass("npc_crow"); -- get all the npc_birds in the map for count,bird in pairs(allBirds) do -- get all the entities near the bird local entsInBirdSphere = ents.FindInSphere(bird:GetPos(), -- the sphere center is on the bird bird_Damage_Radius); -- the radius for count2, entity in pairs(entsInBirdSphere) do if(entity.IsPlayer()) then birdDamagePlayer( bird, entity ); -- pass it on to our damage function end end end end hook.Add("Think", "Bird Damage Checker", checkBirds); -- make the gamemode use checkBirds every frame