I'm getting the Error
"_bomberGroup = |#|_bomberGroup + [_uid]; undefined variable in expression _bomberGroup"
I can't find this on the internet all the tutorials seem to just cover basic use. Here is my code, it could be completely wrong but I am new to this but getting better every day.
if (!isServer || !isDedicated) then {
waitUntil {!isNull player};
waitUntil {(getPlayerUID player) != ""};
while {true} do {
_uid = getPlayerUID player;
_bomberGroup = [];
_bomberGroup = _bomberGroup + [_uid];
};
} forEach allUnits;
if (isServer || isDedicated) then {
_rnd = floor (random (count _bomberGroup));
bomber = _bomberGroup select _rnd;
bomber addBackpack "B_AssaultPack_khk";
bomber addMagazine "DemoCharge_Remote_Mag";
};
_bombHint = "You have the bomb";
if (bomber == player) then {
hint _bombHint;
};
I'm trying to give one of the players that join at the start of the mission a backpack and a charge. I had this code kinda working but it seemed like more than one player would get the bomb sometimes. I think this way would prevent that. thanks for any help