;v.1
_units = (count units group player)
? _units == 12: goto full
? _units == 1: goto one
? _units == 2: goto two
? _units == 3: goto three
? _units == 4: goto four
? _units == 5: goto five
? _units == 6: goto six
? _units == 7: goto seven
? _units == 8: goto eight
? _units == 9: goto nine
? _units == 10: goto ten
? _units == 11: goto eleven
#one
money = money - 5
"PCSailor3" createunit [getpos aa, g1, "S2 = This; removeallweapons this;", .1, "private"]
exit
#two
money = money - 5
"PCSailor3" createunit [getpos aa, g1, "S3 = This; removeallweapons this;", .1, "private"]
exit
#Three
money = money - 5
"PCSailor3" createunit [getpos aa, g1, "S4 = This; removeallweapons this;", .1, "private"]
exit
#four
money = money - 5
"PCSailor3" createunit [getpos aa, g1, "S5 = This; removeallweapons this;", .1, "private"]
exit
#five
money = money - 5
"PCSailor3" createunit [getpos aa, g1, "S6 = This; removeallweapons this;", .1, "private"]
exit
#six
money = money - 5
"PCSailor3" createunit [getpos aa, g1, "S7 = This; removeallweapons this;", .1, "private"]
exit
#seven
money = money - 5
"PCSailor3" createunit [getpos aa, g1, "S8 = This; removeallweapons this;", .1, "private"]
exit
#eight
money = money - 5
"PCSailor3" createunit [getpos aa, g1, "S9 = This; removeallweapons this;", .1, "private"]
exit
#nine
money = money - 5
"PCSailor3" createunit [getpos aa, g1, "S10 = This; removeallweapons this;", .1, "private"]
exit
#ten
money = money - 5
"PCSailor3" createunit [getpos aa, g1, "S11 = This; removeallweapons this;", .1, "private"]
exit
#eleven
money = money - 5
"PCSailor3" createunit [getpos aa, g1, "S12 = This; removeallweapons this;", .1, "private"]
exit
This is a script i made to detect the amount of soldiers in the players group so that a certain named soldier could be added. However, it seems that only the first createunit works, then it just keeps going to "one" to create soldiers, which is bad because only one soldier can have the unique name of s2, the third soldier (including player) needs to be named s3, and the fourth s4 and so on. Where am i erring at? I seem to be lax in this sort of script, i havnt got a script to work that has such ifs in it.
Thanks in advance.