• Smarter Npc's
    2 replies, posted
I was wondering if there is an addon that maps the npc's to players, Currently you have to attack them to get their attention. I have seen it somewhere, just cant remember the name.
[QUOTE=AIX-Who;42754432]I was wondering if there is an addon that maps the npc's to players, Currently you have to attack them to get their attention. I have seen it somewhere, just cant remember the name.[/QUOTE] [CODE] timer.Create('AutoWakeOnPlayerProximal', 1, 0, function() local npcs = {} for k,v in pairs( ents.GetAll() )do if( string.find( v:GetClass(), 'npc' ) )then table.insert( npcs, v ) end end for k,v in pairs( player.GetAll() )do for _, n in pairs( npcs )do if( n:GetPos():Distance( v:GetPos() ) < 1000 )then n:Fire('Wake',0,0); end end end end); [/CODE] Untested but it should cause any NPCs near players to wake up. This could be coded more efficiently if I wasn't on a school computer right now, but that should work fine.
Where should i put this, thanks for the help
Sorry, you need to Log In to post a reply to this thread.