Tetris Game not working :(

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

FusionCore

Supporter
Apr 19, 2020
44
1
8
18
Here is the code so far:
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})
Can you help me?
 
I don't think anyone wants to sit and read that code through, not knowing what exactly to look for .

So you should reply with a more detailed explanation of what exactly you want done, what issues you have, and if you get any errors
 
Status
Not open for further replies.