Hi, Im sorry if im posting at the wrong place. I have this script that i find in old post. it works great in editor mp but in my dedicated server the enemy just spawn and delete it self. im suspecting there is something wrong in the distance part of the script and i have tried to google for the answer but havent seems to hit any good result. Thank you to cobra4v320 for the script.
if (isServer) then {
_spawnPos = _this select 0;
_side = _this select 1;
_patrolDist = if (count _this > 2) then {_this select 2} else {150};
_behavior = if (count _this > 3) then {_this select 3} else {"AWARE"};
_comMode = if (count _this > 4) then {_this select 4} else {"YELLOW"};
_deleteDist = if (count _this > 5) then {_this select 5} else {400};
_spawn = [];
private "_group";
switch (_side) do {
case "east": {
_spawn = ["OIA_InfSquad","OIA_InfSquad_Weapons","OIA_InfTeam","OIA_InfTeam_AT"] call BIS_fnc_selectRandom;
_group = createGroup EAST;
_group = [_spawnPos, east, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> _spawn)] call BIS_fnc_spawnGroup;
};
case "west": {
_spawn = ["BUS_InfSquad","BUS_InfSquad_Weapons","BUS_InfTeam","BUS_InfTeam_AT"] call BIS_fnc_selectRandom;
_group = createGroup WEST;
_group = [_spawnPos, WEST, (configFile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> _spawn)] call BIS_fnc_spawnGroup;
};
};
[_group,_spawnPos,_patrolDist] call bis_fnc_taskPatrol;
{_x setBehaviour _behavior; _x setCombatMode _comMode} forEach (units _group);
waitUntil { player distance ((units _group) select 0) > _deleteDist || {alive _x} count (units _group) == 0 };
{deletevehicle _x} forEach (units _group);
deleteGroup _group;
};