I wanted to give the last human surviving the abillity to freeze all opponents and hide for 30 secs. I came up with the following code which got me a syntax error:
Code:
LastAliveFreeze() {
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "[{+actionslot 1}]", "+actionslot 1" );
for(;;)
{
self waittill ( "[{+actionslot 1}]" );
self PlaySoundToPlayer( "item_nightvision_on", self );
{
level.attackFreeze = self.team;
foreach ( player in level.players )
{
if ( player.team != level.attackFreeze )
{
level.doFreeze = 1;
player thread doFreeze();
self hide();
wait 30;
player thread unFreeze();
self unhide();
}
}
doFreeze()
{
while ( level.doFreeze == true )
{
self freezeControls(true);
wait 0.05;
}
}
unFreeze()
{
level.doFreeze = 0;
self freezeControls(false);
}
What did i do wrong and how can i make it so he can only do it once ?