Code:
//Variables
_l1targets = [l1t1, l1t2, l1t3, l1t4, l1t5, l1t6, l1t7, l1t8, l1t9, l1t10, l1t11, l1t12, l1t13, l1t14, l1t15, l1t16, l1t17, l1t18, l1t19, l1t20, l1t21, l1t22, l1t23, l1t24, l1t25, l1t26, l1t27, l1t28, l1t29, l1t30];
// So that the targets don't pop up by them selves.
nopop = true;
// Should be 0 but needs to be 1 to make the target count correct.
_l1foo = 1;
// Current Hit count.
_l1hc = 0;
// Number of targets in the variable... For randomness.
_l1ntargets = count _l1targets;
// Script
{_x animate["terc",1]} forEach _l1targets;
nul=["Lane 1 Rifle Range Starting in 5...","side",rangeofficer] execVM "20thSFG Scripts\mp_chat.sqf";
sleep 1;
nul=["Lane 1 Rifle Range Starting in 4...","side",rangeofficer] execVM "20thSFG Scripts\mp_chat.sqf";
sleep 1;
nul=["Lane 1 Rifle Range Starting in 3...","side",rangeofficer] execVM "20thSFG Scripts\mp_chat.sqf";
sleep 1;
nul=["Lane 1 Rifle Range Starting in 2...","side",rangeofficer] execVM "20thSFG Scripts\mp_chat.sqf";
sleep 1;
nul=["Lane 1 Rifle Range Starting in 1...","side",rangeofficer] execVM "20thSFG Scripts\mp_chat.sqf";
sleep 1;
nul=["Lane 1 Rifle Range Active...","side",rangeofficer] execVM "20thSFG Scripts\mp_chat.sqf";
while {_l1foo<21} do {
_l1rnumber = random _l1ntargets-1;
_l1rtarget = _l1targets select _l1rnumber;
_l1rtarget animate["terc", 0];
sleep 3;
if (_l1rtarget animationPhase "terc" > 0.1) then
{
_l1hc = _l1hc+1;
};
_l1rtarget animate["terc", 1];
_l1foo = _l1foo + 1;
sleep random 5;
};
nul=[format["Lane 1 Firing Range Inactive... Final Score: %1/20.", _l1hc],"side",rangeofficer] execVM "20thSFG Scripts\mp_chat.sqf";
sleep 3;
// Reset the targets.
{_x animate["terc",0]} forEach _l1targets;