Getting npcs spawned by map without using ents.GetAll()
2 replies, posted
I am trying to get ents that are spawned by my map as they spawn, sort of like [url]http://wiki.garrysmod.com/page/SANDBOX/PlayerSpawnedNPC[/url]. Been backwards and forward through the wiki and cant seem to find anything. Anyone have a suggestion?
The hook you want is [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/OnEntityCreated]GM:OnEntityCreated[/url] where you can use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/IsNPC]Entity:IsNPC[/url], but I'm not sure how you can tell whether it was created by the map.
Edit: oh. [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/CreatedByMap]Entity:CreatedByMap[/url]
Awesome, thanks a bunch
Sorry, you need to Log In to post a reply to this thread.