Spawn an NPC... not outside the map

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.


pos = SetPos( Player:GetPos() + Vector( math.random(-500, 500), math.random(-500, 500), 600 ) )

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

Thanks, no idea how I missed that :slight_smile: I wish the wiki wasn’t crapped up

Wow, thanks too :smiley: