Jump to content
Sign in to follow this  
RogerJ

I can not create groups with trigger

Recommended Posts

The code below works in the preview editor, in dedicated server (MP) groups are created infinitely :(

what is wrong?

thank you

for "_i" from 1 to 2 do { grp = [getMarkerPos "ex_infant", EAST, (configFile >> "CfgGroups" >> "East" >> "BIS_TK_INS" >> "Infantry" >> "TK_INS_Group")] call BIS_fnc_spawnGroup; [grp, getMarkerPos "ex_infant", 50] call bis_fnc_taskPatrol}

Share this post


Link to post
Share on other sites

Triggers are run on ALL connected clients and the server, so if you have that code in the trigger onAct it'll run once for everyone connected.

Put that code in a script that the trigger runs and put this as the first line of that script:

if (!isServer) exitWith {};

That way it'll run on all the clients, but anyone BUT the server will quit the script and only the server will spawn the guys, once.

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  

×