Blockland Forums > Modification Help

playerList / deadCheck

Pages: (1/1)

Kaphonaits:

How can I check if a player is dead?
How can get a random number?
How can I loop through the playerList (while in / out of a miniGame)?

Be specific please.

Daenth:

1.
--- Code: ---if(!isObject(%client.player)) { //code }
--- End code ---

2.
--- Code: ---%randomNum = getRandom(); //Generates any random number.
%randomNum1 = getRandom(1); //Max only.
%randomNum2 = getRandom(1,2); //Min/Max
--- End code ---

3.
--- Code: ---ClientGroup.getCount(); //Number of Players
ClientGroup.getObject(%num); //Targets the "%num" player.
--- End code ---


Treynolds416:

In addition, I believe slayer has support for %client.dead or something similar

Fluff-is-back:


--- Quote from: Daenth on April 05, 2012, 03:21:19 AM ---3.
--- Code: ---ClientGroup.getCount(); //Number of Players
ClientGroup.getObject(%num); //Targets the "%num" player.
--- End code ---

--- End quote ---

therefore

for(%i =0; %i < clientGroup.getCount(); %i++)
{
    %client = clientGroup.getObject(%i);
    %client.doStuff();
}


Pages: (1/1)

Go to full version