Jump to content
Sign in to follow this  
jstibbsy

Spawned in zombies (via script) spawning weird

Recommended Posts

So I've got zombies spawning in at certain times and they work perfectly in singleplayer, they spawn at the markers and work fine.
But in multiplayer some spawn at 0,0,0. I have no idea why. 

zombieSpawns = [
	"zombie_spawn1",
	"zombie_spawn2",
	"zombie_spawn3"
];

The above is the array for the markers they spawn at.
 

for "_i" from 1 to ((rounds select roundNum) select 0) do
	{
		waitUntil {zombiesAlive < enemyMax};
		_spawnPoint = zombieSpawns call BIS_fnc_selectRandom;
		_zombie = slowZombies call BIS_fnc_selectRandom;
		//_zombieObj = missionNamespace getVariable [_zombie, objNull];
		_randomhat = _headgear call BIS_fnc_selectRandom;
		_randomuniform = _uniform call BIS_fnc_selectRandom;
		_randomvest = _vest call BIS_fnc_selectRandom;
		zombiesAlive = zombiesAlive + 1;
		_zombie createUnit [getMarkerPos _spawnPoint, zombieGroup, 
			"this switchmove 'AmovPercMstpSnonWnonDnon_SaluteOut'; 
			this setpos [(getpos this select 0) + random 15 - random 15, (getpos this select 1) + random 15 - random 15];
			removeHeadgear this;
		removeVest this;
		this addHeadgear _randomhat;
		this addUniform _randomuniform;
		this addvest _randomvest;
			this addEventHandler ['killed', {[_this] spawn killed_zombie }]; 
			this addEventHandler ['HandleDamage', {if (alive (_this select 0) and (_this select 1) isEqualTo 'neck') then {(_this select 3) setVariable ['money', ((_this select 3) getVariable 'money') + moneyOnDamage, true];};}];"];
	};

That is a snippet of the code and how they are meant to spawn. (yes everything is defined) 
If you need more code then I'll be happy to show more. I'm just wondering if one of you can spot an error or possible solution.

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
Sign in to follow this  

×