Jump to content

Recommended Posts


I am very new to coding.

I need a code/script to make enemies know where all the player location are and follow them (they do it automatically anyway?)

Basically i need to make the AI know the location of all player and hunt them down, even if they where spawned in via script or already ingame. 

preferably in a loop maybe? so they get updated, i donno every 30 seconds? or more.

Im very new and bad at coding, i tried reading up on it. but i failed. i tried google it, but to be real, i dont really know what to look for.


This is the last part of my mission to get it fully functional.

Share this post

Link to post
Share on other sites

Execute this script in your initServer.sqf :


while {true} do {

	_allPlayers = allPlayers;

	  if ((side _x) == east) then // put the right ennemy side
	     for "_i" from 0 to count _allplayers -1 do {

	     _x reveal [(_allplayers) select _i, 4];

	} forEach allUnits;

	sleep 30; // every 30 seconds


Share this post

Link to post
Share on other sites

These are all the collected threads for the AI to hunt, or chase the player from my AI Compilation list

linked in my sig, hope these can further help you if you need it.


Script enemy chases player


How to make AI Hunt a player down while he is on the move?

How to make AI KNOW where player is?

AI to stalk player group

Sneaky Hunter AI

Group chasing/hunting the player

Enemies follow players?

Trying do make enemy hunt player script.

All remaining enemy Chase player/team

Making enemy units chase player

AI hunting player

  • Like 2

Share this post

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now