Author Topic: Script looping through player?  (Read 694 times)

How would i go about looping through all the players on the server and only the player in the minigame that i am in?

Looping through the server and finding players in your minigame:
Code: [Select]
for(%i=0;%i<ClientGroup.getCount();%i++)
{
%targetclient = ClientGroup.getObject(%i);
if(isObject(%targetclient.minigame) && %targetclient.minigame == %client.minigame)
{
//do stuff to %targetclient
}
}
However if you simply wish to loop through everyone in the minigame this will be faster:
Code: [Select]
if(isObject(%client.minigame))
{
for(%i=0;%i<%client.minigame.numMembers;%i++)
{
%targetclient = %client.minigame.member[%i];
                //do stuff to %targetclient
}
}