Advertisement
Silverlan

Untitled

Jan 23rd, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. local tbSentries = {"monster_sentry","monster_sentry_decay","monster_miniturret","monster_miniturret_ceiling"}
  2. hook.Add("PlayerSpawnedNPC","sentryrel",function(pl,npc)
  3. local class = npc:GetClass()
  4. if(table.HasValue(tbSentries,class)) then
  5. for _, pl in ipairs(player.GetAll()) do
  6. npc:AddEntityRelationship(pl,D_LI,100)
  7. end
  8. end
  9. end)
  10.  
  11. hook.Add("PlayerSpawn","sentryrelplspawn",function(pl)
  12. for _, class in ipairs(tbSentries) do
  13. for _, ent in ipairs(ents.FindByClass(class)) do
  14. ent:AddEntityRelationship(pl,D_LI,100)
  15. end
  16. end
  17. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement