• Spawn an NPC... not outside the map
    3 replies, posted
Hi all, Basically, this works great until someone goes to the corner of the map. Then the NPC start to spawn outside the map and it makes the game too easy. [CODE]pos = SetPos( Player:GetPos() + Vector( math.random(-500, 500), math.random(-500, 500), 600 ) )[/CODE] How do I check that this Position is not outside the map? How do I detect when the NPC is stuck in a prop? Thanks
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index5b2d.html?title=Entity.IsInWorld[/url]
Thanks, no idea how I missed that :) I wish the wiki wasn't crapped up
Wow, thanks too :D
Sorry, you need to Log In to post a reply to this thread.