I have an Lua-coding question: How to get all npc's on a map and set them some weapons?
For example, pistol.
you go into your Q menu, and up in the top left you click the second button, and a drop down menu should show up you change their weapon in that menu, and then you can just spawn npcs into the map.
[QUOTE=Monsterkiller;41798151]you go into your Q menu, and up in the top left you click the second button, and a drop down menu should show up you change their weapon in that menu, and then you can just spawn npcs into the map.[/QUOTE]
It is LUA question.
Solved.
[QUOTE]
for k, entity in pairs( ents.GetAll() ) do
...
end
[/QUOTE]
If its just one type of npc then use [url=http://wiki.garrysmod.com/page/ents/FindByClass]FindByClass[/url] and then call [url=http://wiki.garrysmod.com/page/NPC/Give]Give[/url] on the npc with the weapon you want them to have.
[QUOTE=mcd1992;41800053]If its just one type of npc then use [url=http://wiki.garrysmod.com/page/ents/FindByClass]FindByClass[/url] and then call [url=http://wiki.garrysmod.com/page/NPC/Give]Give[/url] on the npc with the weapon you want them to have.[/QUOTE]
Thanks. :)
Sorry, you need to Log In to post a reply to this thread.