# For Each Player In Player Group

Grammar — For each player var|Player in group do (Actions)
FlagsSubFunctions | Action

Executes a For Loop using an integer value. This will run the action set included under the For Each Player In Player Group action for every player in the specified player group. For example: If you put a “Set Player Color” action that changed the color for Player , under a For Each Player In Player Group action with the Player Group parameter set to All Players, it would change the color for all players.

# Arguments

  • anyvariable — Player Variable
  • playergroup — Player Group

Returns — void

#AUTOVAR(g, playergroup) = #PARAM(group);
#PARAM(var) = -1;
while (true) {
    #PARAM(var) = PlayerGroupNextPlayer(#AUTOVAR(g), #PARAM(var));
    if (#PARAM(var) < 0) { break; }
    #SUBFUNCS(actions)
}

Category: Player Group / Loops

# Examples

— None found —