Blockland Forums > Modification Help

How do i make a minigame select a random player each time to a team

Pages: (1/3) > >>

MonkeyFunkyMonkey:

What i want is a script or gamemode that randomizes player and puts one on other time and puts other on the other team maybe something like this for(%i = 0;%i < ClientGroup.getCount();%i++)
   {
      %client = ClientGroup.getObject(%i);
      %client.isit = false;            //gotta make sure who ever was it last game isn't it anymore
      %client.isPlaying = true;
      %client.lasttag = "";
      %client.frozen = false;
      if(isObject(%client.player))
      {
      %client.player.setShapeNameColor(%client,"");
      %client.player.changedatablock("PlayerStandardArmor");
      }
   }

   %client = ClientGroup.getObject(getRandom(0,ClientGroup.getCount()-1));   //select a random person
   %client.isit = true;               //make him it
   if(isObject(%client.player))
   %client.player.setShapeNameColor(%client,"");
   messageall('',%client.name @ " is the first tagger!");   //and tell everyone about it




Zloff:

wtf is this stuff

blockhead55:

Ask cucumberdude.

MonkeyFunkyMonkey:

i did he told me to post here

--- Quote from: cucumberdude on June 19, 2011, 11:50:35 PM ---Post in coding help, I'm not a private torquescript instructor or something.

--- End quote ---


Daenth:

%clientcount = ClientGroup.getCount() - 1;
%i = getRandom(0,%clientcount);
%randomperson = ClientGroup.getObject(%i);

This should work.

Pages: (1/3) > >>

Go to full version