CS2D
Scripts
Select the last one alive
Select the last one alive
5 replies 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. First part(releasing) can be done with mapping. DC Admin
Offline
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] 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. 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.
DC Admin
Offline
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)