Here is the code so far:
Can you help me?
Code:
function gameStart(p: player):
set {isClosed.%{_p}%} to false
if {isClosed.%{_p}%} is not set:
set {isClosed.%{_p}%} to false
open virtual chest inventory with size 6 named "&8[&7Sk&6&lTetris&r&8] &7Game" to {_p}
format gui slot 45,46,47,48,50,51,52,53 of {_p} with gray stained glass pane named "&7"
format gui slot 49 of {_p} with barrier named "&cClose" to run:
set {isClosed.%{_p}%} to true
close player's inventory
set {_integer} to random integer between 1 and 9
set {_color} to random integer between 1 and 3
if {_color} is 1:
set {_color.stained} to "red"
if {_color} is 2:
set {_color.stained} to "blue"
if {_color} is 3:
set {_color.stained} to "green"
if {isClosed.%{_p}%} is false:
if slot {_integer} + 9 of {_p}'s inventory is not set:
wait 1 seconds
if {_color.stained} is "red":
format gui slot {_integer} of {_p} with red stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
if {_color.stained} is "blue":
format gui slot {_integer} of {_p} with blue stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
if {_color.stained} is "green":
format gui slot {_integer} of {_p} with green stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
add 9 to {_integer}
if {isClosed.%{_p}%} is false:
if slot {_integer} + 9 of {_p}'s inventory is not set:
wait 1 seconds
set {_reversed_integer} to {_integer} - 9
format gui slot {_reversed_integer} of {_p} with air
if {_color.stained} is "red":
format gui slot {_integer} of {_p} with red stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
if {_color.stained} is "blue":
format gui slot {_integer} of {_p} with blue stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
if {_color.stained} is "green":
format gui slot {_integer} of {_p} with green stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
add 9 to {_integer}
if {isClosed.%{_p}%} is false:
if slot {_integer} + 9 of {_p}'s inventory is not set:
wait 1 seconds
set {_reversed_integer} to {_integer} - 9
format gui slot {_reversed_integer} of {_p} with air
if {_color.stained} is "red":
format gui slot {_integer} of {_p} with red stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
if {_color.stained} is "blue":
format gui slot {_integer} of {_p} with blue stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
if {_color.stained} is "green":
format gui slot {_integer} of {_p} with green stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
add 9 to {_integer}
if {isClosed.%{_p}%} is false:
if slot {_integer} + 9 of {_p}'s inventory is not set:
wait 1 seconds
set {_reversed_integer} to {_integer} - 9
format gui slot {_reversed_integer} of {_p} with air
if {_color.stained} is "red":
format gui slot {_integer} of {_p} with red stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
if {_color.stained} is "blue":
format gui slot {_integer} of {_p} with blue stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
if {_color.stained} is "green":
format gui slot {_integer} of {_p} with green stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
add 9 to {_integer}
if {isClosed.%{_p}%} is false:
if slot {_integer} + 9 of {_p}'s inventory is not set:
wait 1 seconds
set {_reversed_integer} to {_integer} - 9
format gui slot {_reversed_integer} of {_p} with air
if {_color.stained} is "red":
format gui slot {_integer} of {_p} with red stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
if {_color.stained} is "blue":
format gui slot {_integer} of {_p} with blue stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
if {_color.stained} is "green":
format gui slot {_integer} of {_p} with green stained glass pane named "&7Tetris block" with lore "&f&lLook out!"
if {isClosed.%{_p}%} is false:
gameStart({_p})