Blockland Forums > Modification Help
Last guy standing script
<< < (2/3) > >>
aml:

--- Quote from: Chrono on July 28, 2010, 04:09:20 PM ---Loop through the minigame's members.
Check if they're on the same team as the one who died.
Count the number of them that are alive.

--- End quote ---
I know what to do its just I have no idea on how I would do it.
Chrono:
Then put it in suggestions and requests so someone else can do it.
herb:
this works, but if both teams have 1 player left, it will only grab 1 player

u can do in your package test

if(test() != 0)messageAll('',test().name@" is the only player left on the "@test().minigame.teamname[test().tdmteam]@" team!");

or something.


--- Code: ---function test()
{
for(%i=0; %i<clientGroup.getCount(); %i++)
{
%client=clientGroup.getObject(%i);

if(%client.minigame == 0)
continue;

if(%client.player !$= "")
{
%teamone=%client.miningame.teamname[%client.tdmteam];
if(%client.minigame.teamname[%client.tdmteam] !$= %teamone)
{
%teamtwo=%client.minigame.teamname[%client.tdmteam];
break;
}
}
}



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

if(%client.minigame == 0)
continue;

if(%client.minigame.teamname[%client.tdmteam] $= %teamone)
%teamonecount++;

if(%client.minigame.teamname[%client.tdmteam] $= %teamTwo)
%teamTwoCount++;
}

if(%teamOneCount==1)
{
for(%i=0; %i<clientGroup.getCount(); %i++)
{
%client=clientGroup.getObject(%i);

if(%client.minigame == 0)
continue;
if(%client.minigame.teamName[%client.tdmTeam] $= %teamone)
return %client;
}
}

if(%teamtwoCount==1)
{
for(%i=0; %i<clientGroup.getCount(); %i++)
{
%client=clientGroup.getObject(%i);

if(%client.minigame == 0)
continue;

if(%client.minigame.teamName[%client.tdmTeam] $= %teamTwo)
return %client;
}
}

return false;

}

--- End code ---
MegaScientifical:
loveist script... Needs more Person.
herb:
did it work?
Navigation
Message Index
Next page
Previous page

Go to full version