Jump to content
  • 0

AI pushing people away script


Nemaconz

Question

Trying to get certain AI of mine to push people back if they get to close, but the script I wrote is not working, any script Gods here think they can lend a hand?

 

_playerpresent = (position _aiunit) nearEntities ["Man", _wpradius];

_aiunit spawn {
    while {alive _this} do
    {     
        _playerPresent = false;
        {if((isPlayer _x) && (_x distance _aiunit <= 20)) then {_playerPresent = true};}forEach playableUnits;
        while (_playerPresent) do {_x setVelocity [10,10,10];};
    };
  };
 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...