For Loop Explanation:
http://forums.graalonline.com/forums...11&postcount=4
You also can't modify the 'players' array.
Here's a common method for placing each person a different team, by just using an alternating boolean/flag.
PHP Code:
function setupTeams() {
// Initialize flag so first player is added to the Red team
temp.red = true;
// Loop through players in level
for (temp.plyr: players) {
// Ignore Events Team / Admin
if (!temp.plyr.guild.starts("Events")) {
// Check if setting to Red team.
if (temp.red) {
// Set guild to Red
temp.plyr.guild = "Red";
// Reset flag so next player is blue
temp.red = false;
} else {
// Set guild to Blue
temp.plyr.guild = "Blue";
// Set flag so next player is red
temp.red = true;
}
}
}
}