Ok, So I need help.
I've created safe zones, but AI is still able to come into the zone.
I want to only allow the player into the safe Zone.
What should I add code too?
the AI to keep it out, Or The Safezone to only allow players.
and how exactly would I do this?
Copyright © 2025 BYOND Software.
All rights reserved.
Both options are discussed in this thread, and of course many other threads discuss the topic (you should generally try the forum search to look for an answer for your question first - saves you, and others, time). You can do either, but if you only make the safezone reject your NPCs without changing the NPC's AI appropriately, you could easily make your AI dumb, as it could end up, for example, trying to chase a player inside a safe zone over and over again, and being rejected each time - which is, of course, pretty useless and exploitable. In such a situation you'll want to program the AI to try doing something more productive, like look for another target, run away etc.
A misc note: you may have to do more than just control movement in order to fully implement a 'safe zone', f.ex. maybe some of your monsters can use ranged attacks - you'll want to modify the code responsible for that so players in safe zones aren't attacked/targeted. Also, you may want to prevent monsters from attacking players in the edge of a safe zone as well; if you only limit movement, that can still occur. Etc.