_count = (count units maingroup) - 12
#createstart
?_count == 0: goto "vehiclecheck"
_count = _count +1
_rand = random 100
_skill = random 1
?_rand > 95: _bmp = true; _t55 = false; _t72 = false; _t80 = false
?_rand > 96: _t55 = true; _bmp = false; _t72 = false; _t80 = false
?_rand > 97: _t72 = true; _bmp = false; _t55 = false; _t80 = false
?_rand > 98: _t80 = true; _bmp = false; _t55 = false; _t72 = false
?_rand < 20: goto "hunter"
?(_rand >= 20) && (_rand < 35): goto "SoldierGB"
?(_rand >= 35) && (_rand < 50): goto "SoldierGG"
?(_rand >= 50) && (_rand < 60): goto "SoldireGMedic"
?(_rand >= 60) && (_rand < 70): goto "SoldireGMG"
?(_rand >= 70) && (_rand < 80): goto "SoldireGSniper"
?(_rand >= 80) && (_rand < 90): goto "SoldireGLAW"
?(_rand >= 90): goto "SoldireGAT"
#Hunter
?(local server): "Hunter" createunit [[(getpos (leader maingroup) select 0)+20,(getpos (leader maingroup) select 1)+20,0], maingroup, "",_skill]
goto "createstart"
#SoldierGB
?(local server): "SoldierGB" createunit [[(getpos (leader maingroup) select 0)+20,(getpos (leader maingroup) select 1)+20,0], maingroup, "",_skill]
goto "createstart"
#SoldierGG
?(local server): "SoldierGG" createunit [[(getpos (leader maingroup) select 0)+20,(getpos (leader maingroup) select 1)+20,0], maingroup, "",_skill]
goto "createstart"
#SoldierGMedic
?(local server): "SoldierGMedic" createunit [[(getpos (leader maingroup) select 0)+20,(getpos (leader maingroup) select 1)+20,0], maingroup, "",_skill]
goto "createstart"
#SoldierGMG
?(local server): "SoldierGMG" createunit [[(getpos (leader maingroup) select 0)+20,(getpos (leader maingroup) select 1)+20,0], maingroup, "",_skill]
goto "createstart"
#SoldierGSniper
?(local server): "SoldierGSniper" createunit [[(getpos (leader maingroup) select 0)+20,(getpos (leader maingroup) select 1)+20,0], maingroup, "",_skill]
goto "createstart"
#SoldierGLAW
?(local server): "SoldierGLAW" createunit [[(getpos (leader maingroup) select 0)+20,(getpos (leader maingroup) select 1)+20,0], maingroup, "",_skill]
goto "createstart"
#SoldierGAT
?(local server): "SoldierGAT" createunit [[(getpos (leader maingroup) select 0)+20,(getpos (leader maingroup) select 1)+20,0], maingroup, "",_skill]
goto "createstart"
#vehiclecheck
#BMPRes
?_bmp && (local server): _tank = "BMPRes" createVehicle [(getpos (leader maingroup) select 0)-20,(getpos (leader maingroup) select 1)-20,0]
exit
#T55G
?_t55 && (local server): _tank = "T55G" createVehicle [(getpos (leader maingroup) select 0)-20,(getpos (leader maingroup) select 1)-20,0]
exit
#T72Res
?_t72 && (local server): _tank = "T72Res" createVehicle [(getpos (leader maingroup) select 0)-20,(getpos (leader maingroup) select 1)-20,0]
exit
#T80Res
?_t80 && (local server): _tank = "T80Res" createVehicle [(getpos (leader maingroup) select 0)-20,(getpos (leader maingroup) select 1)-20,0]
exit
The script is supposed to count the units in 'maingroup' and create so many as is missing from 12. Last time I got 1 MG soldier and before that 2 hunters. I know the script works, but it's just that it seems to stop looping too soon or something.
Anyone spot an error my eye can't see (besides the bad editing.. save it)? ;D