this is a heavily asked thing so here is my code for this
Conditions- 1-need at least 4 players to start game
2-Players do @queue to participate in queue
Player action Chat event - If player Message equals ( @queue(text book)) If variable not equals ( Top slot %player%queue (saved var.) Bottom slot(True(text book)) { If variable not equals ( Top slot Game_started (saved var.) Bottom slot(True(text book)) { Increment Variable 1st slot( players_queued(saved var) 2nd slot(1(num value)) - Set variable (Top slot %player%queue (saved var.) Bottom slot(True(text book)) - Send Message all ( %player% has Queued for game players_queued(saved var) - Game action wait (leave empty) If variable equals (1st slot( players_queued(saved var) 2nd slot( 4 (num value) - Game action Start loop (queue ends (text book)}Else Player action send message ( game has already started(text book) } Else Player action send message (You are already in queue(text book )}
Loop Block named (queue ends) set to 20 ticks - Increment variable ( 1st slot (counter1(saved var)) 2nd slot (1(num value)) - Set to difference ( First slot (Counter2 (saved var) second slot(counter1(saved var)) Third slot(5 (Numerical value)) - If variable greater than ( First slot(Counter1(saved var) second slot(5 (num value)){ Stop loop (queue ends(textbook)) Call function ( Game starts ) - Set variable (1st slot (Game_started(saved var) 2nd slot( true(textbook)) - Set variable (1st slot (Counter1(saved var) 2nd slot( 0(Num value)) Player action Send message all ( GAME HAS STARTED!!(textbook)}Else Player action send message all ( Game will start in Counter2(saved var) seconds
WHAT to do next
then u need to make the function game start which is u give all players who queued some items or teleport them somewhere etc
and you need to plan the ending you game too when ending set the variable %player%queue and players_queued and Game_started to 0
{is the placement of the piston and - means in the same line inside the same piston bracket
good luck ill post pics of this coded in a game later
Conditions- 1-need at least 4 players to start game
2-Players do @queue to participate in queue
Player action Chat event - If player Message equals ( @queue(text book)) If variable not equals ( Top slot %player%queue (saved var.) Bottom slot(True(text book)) { If variable not equals ( Top slot Game_started (saved var.) Bottom slot(True(text book)) { Increment Variable 1st slot( players_queued(saved var) 2nd slot(1(num value)) - Set variable (Top slot %player%queue (saved var.) Bottom slot(True(text book)) - Send Message all ( %player% has Queued for game players_queued(saved var) - Game action wait (leave empty) If variable equals (1st slot( players_queued(saved var) 2nd slot( 4 (num value) - Game action Start loop (queue ends (text book)}Else Player action send message ( game has already started(text book) } Else Player action send message (You are already in queue(text book )}
Loop Block named (queue ends) set to 20 ticks - Increment variable ( 1st slot (counter1(saved var)) 2nd slot (1(num value)) - Set to difference ( First slot (Counter2 (saved var) second slot(counter1(saved var)) Third slot(5 (Numerical value)) - If variable greater than ( First slot(Counter1(saved var) second slot(5 (num value)){ Stop loop (queue ends(textbook)) Call function ( Game starts ) - Set variable (1st slot (Game_started(saved var) 2nd slot( true(textbook)) - Set variable (1st slot (Counter1(saved var) 2nd slot( 0(Num value)) Player action Send message all ( GAME HAS STARTED!!(textbook)}Else Player action send message all ( Game will start in Counter2(saved var) seconds
WHAT to do next
then u need to make the function game start which is u give all players who queued some items or teleport them somewhere etc
and you need to plan the ending you game too when ending set the variable %player%queue and players_queued and Game_started to 0
{is the placement of the piston and - means in the same line inside the same piston bracket
good luck ill post pics of this coded in a game later