• How to make an NPC?
    2 replies, posted
Hello, I am pretty good at lua, except for NPC's, and I have been putting it off for a while and now is the time I actually have to do it. I want to make an npc kind of like hl2's zombie, where it goes to you within a certain radius and then attacks you. Is there a tutorial or something on this?
I don't think threre are, and coding an NPC is probably one of the hardest things to code in GMod.
You're looking for stuff on "nextbot". If your map doesn't have ai nodes in it then you may also have to look at the gmsv_navigation module since nextbots rely on nodes for their automatic pathfinding. This thread has some example nextbot code and stuff: [url]http://www.facepunch.com/showthread.php?t=1260326[/url] You may also want to familiarize yourself with how coroutines work if you don't already know.
Sorry, you need to Log In to post a reply to this thread.