Forum

> > CS2D > Scripts > Select the last one alive
Forums overviewCS2D overview Scripts overviewLog in to reply

English Select the last one alive

5 replies
To the start Previous 1 Next To the start

old Select the last one alive

ARGCaboose
User Off Offline

Quote
Hi guys! I'm very noob scripting but trying to do a lua.

My idea is like this:

There is 1 terrorist (assassin) and the oter players are CTs. The assassin spawn in a closed room, and after 20 seconds it goes released and have to kill every CT. The last one, the surviver goes T at the end of the round and the T goes CT.
It keeps repeting, so if you survive, you are the next assassin.

some help please? :B Bad english, I know.

old Re: Select the last one alive

DC
Admin Off Offline

Quote
player(0,"tableliving") returns a lua table/array with the IDs of all living players.

so if #player(0,"tableliving")==1 then only one player is living and you can get his ID with player(0,"tableliving")[1]

old Re: Select the last one alive

ARGCaboose
User Off Offline

Quote
I did all the map (Relasing and stuff) but you need an admin to play, changing teams I also want to do the assassin a little more faster every time he kills someone.

old Re: Select the last one alive

KimKat
GAME BANNED Off Offline

Quote
How do you select the last player alive in each team? would you need to use the 'if team==1 then' to verify terrorists in example or can this be done another way, simplified? if so how. I'm thinking of creating something awesome.

old Re: Select the last one alive

DC
Admin Off Offline

Quote
kimkat7: read sys/lua/info.txt and you'll see that there's also
player(0,"team1living") and player(0,"team2living") which work like player(0,"tableliving") (see my post above) but only show players of team 1 (t) or 2 (ct)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview