Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tbSentries = {"monster_sentry","monster_sentry_decay","monster_miniturret","monster_miniturret_ceiling"}
- hook.Add("PlayerSpawnedNPC","sentryrel",function(pl,npc)
- local class = npc:GetClass()
- if(table.HasValue(tbSentries,class)) then
- for _, pl in ipairs(player.GetAll()) do
- npc:AddEntityRelationship(pl,D_LI,100)
- end
- end
- end)
- hook.Add("PlayerSpawn","sentryrelplspawn",function(pl)
- for _, class in ipairs(tbSentries) do
- for _, ent in ipairs(ents.FindByClass(class)) do
- ent:AddEntityRelationship(pl,D_LI,100)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement