# SolvedSorting into teams

Status
Not open for further replies.

#### Tom1222322

##### Member
Hello, I've been trying to create a basic skyflag minigame skript, but I ran into a problem. I don't know how to sort player 1 to team a and player 2 to team b and again player 3 to team a, etc.
Code:
``````every 20 ticks:
if size of {sf.players::*} > 1:
if {sf.running} is false:
set {sf.running} to true
if {sf.teamred::*} is 0:
if {sf.teamblue::*} is 0:

Code:
``````every 20 ticks:
if {sf.running} is false:
if size of {sf.players::*} > 1:
set {sf.running} to true
loop {sf.players::*}:
if {_red} is true:
delete {_red}
else:
set {_red} to true

Code:
``````every 20 ticks:
if {sf.running} is false:
set {_size} to size of {sf.players::*}
if {_size} > 1:
set {sf.running} to true
loop {_size} times:
if mod(loop-value,2) is not 0:
else:

Last edited:
Code:
``````[00:02:27 INFO]: Line 78: (skyflag.sk)
[00:02:27 INFO]:     The function 'mod' requires at least 2 arguments, but only 1 is given.
[00:02:27 INFO]:     Line: if mod(loop-value/2) is not 0:
[00:02:27 INFO]:
[00:02:27 INFO]: Line 82: (skyflag.sk)
[00:02:27 INFO]:     'else' has to be placed just after another 'if' or 'else if' section
[00:02:27 INFO]:     Line: else:``````
Code:
``````every 20 ticks:
if {sf.running} is false:
if size of {sf.players::*} > 1:
set {sf.running} to true
loop {sf.players::*}:
if {_red} is true:
delete {_red}
else:
set {_red} to true

Code:
``````every 20 ticks:
if {sf.running} is false:
set {_size} to size of {sf.players::*}
if {_size} > 1:
set {sf.running} to true
loop {_size} times:
if mod(loop-value/2) is not 0:
else:
I keep getting this error, no idea why tho.

Code:
``````[00:02:27 INFO]: Line 78: (skyflag.sk)
[00:02:27 INFO]:     The function 'mod' requires at least 2 arguments, but only 1 is given.
[00:02:27 INFO]:     Line: if mod(loop-value/2) is not 0:
[00:02:27 INFO]:
[00:02:27 INFO]: Line 82: (skyflag.sk)
[00:02:27 INFO]:     'else' has to be placed just after another 'if' or 'else if' section
[00:02:27 INFO]:     Line: else:``````

I keep getting this error, no idea why tho.
oh,
Code:
``mod(loop-value,2)``
my mistake

oh,
Code:
``mod(loop-value,2)``
my mistake
It works now, thank you.

Status
Not open for further replies.