#help with gui

1 messages · Page 1 of 1 (latest)

coral summit
#
  clue1: "I have lots of books."
  clue2: "You can cook food here."
  clue3: "I am full of animals."
  answer1: "library"
  answer2: "kitchen"
  answer3: "zoo"

# Initialize player guess tracking
on join:
  set {_guessed::%player%::1} to false
  set {_guessed::%player%::2} to false
  set {_guessed::%player%::3} to false

command /guessinggame:
  permission: op
  trigger:
    open chest inventory with 3 rows named "Guessing Game Clues" to player
    set slot 0 of player's current inventory to stone named "Clue 1"
    set slot 1 of player's current inventory to stone named "Clue 2"
    set slot 2 of player's current inventory to stone named "Clue 3"

on inventory click:
  if name of event-inventory is "Guessing Game Clues":
    cancel event
    if event-slot is 0:
      give player paper named "Clue 1" with lore "%{_clue1}%" to player
      send "You received Clue 1!" to player
    else if event-slot is 1:
      give player paper named "Clue 2" with lore "%{_clue2}%" to player
      send "You received Clue 2!" to player
    else if event-slot is 2:
      give player paper named "Clue 3" with lore "%{_clue3}%" to player
      send "You received Clue 3!" to player

command /guess <string> <text>:
  permission: op
  trigger:
    if arg-1 is "1":
      if {_guessed::%player%::1} is false:
        if arg-2 is {@answer1}:
          give player diamond
          send "Correct! You guessed it!" to player
          set {_guessed::%player%::1} to true
        else:
          send "Incorrect. You can only guess once!" to player
      else:
        send "You've already guessed this clue!" to player

    else if arg-1 is "2":
      if {_guessed::%player%::2} is false:
        if arg-2 is {@answer2}:
          give player diamond
          send "Correct! You guessed it!" to player
          set {_guessed::%player%::2} to true
        else:
          send "Incorrect. You can only guess once!" to player
      else:
        send "You've already guessed this clue!" to player

    else if arg-1 is "3":
      if {_guessed::%player%::3} is false:
        if arg-2 is {@answer3}:
          give player diamond
          send "Correct! You guessed it!" to player
          set {_guessed::%player%::3} to true
        else:
          send "Incorrect. You can only guess once!" to player
      else:
        send "You've already guessed this clue!" to player

    else:
      send "Invalid clue number. Use /guess <clueNumber> <guess>." to player

command /guessreset <player> <string>:
  permission: op
  trigger:
    if arg-2 is "1":
      set {_guessed::%arg-1%::1} to false
      send "Reset guess for Clue 1 of %{arg-1}%" to player
    else if arg-2 is "2":
      set {_guessed::%arg-1%::2} to false
      send "Reset guess for Clue 2 of %{arg-1}%" to player
    else if arg-2 is "3":
      set {_guessed::%arg-1%::3} to false
      send "Reset guess for Clue 3 of %{arg-1}%" to player
    else:
      send "Invalid clue number. Use /guessreset <username> <clueNumber>." to player```
#

ok so the gui and everthing in the gui shows up and the guessing command works

#

but when i click on the things it doesnt give the item to get the paper with the clues

coral summit
#

and the guess reset is not reseting the guesses

cunning stratus
#
  1. You cannot bring local variables across events
  2. It is recommended to set a local var/metadata tag to a GUI, set the slots, then open it instead of opening an empty inventory and modifying the player's current inventory
  3. event-slot is the item, if you want its position in the gui, use index of event-slot.
  4. arguments are not variables, to use them in strings it should be "%arg%" not "%{arg}%"

that comment is also kinda sus

coral summit
cunning stratus
#

Makes it seem this is AI code

manic sonnet
coral summit
manic sonnet
#

metadata tags on top

coral summit
#

I don’t really know how to use them

manic sonnet
#

they super simple

#

tutorials on how to use em

#

skunity (obviously)

coral summit
#

I’ll look it up

manic sonnet
# coral summit I’ll look it up

ok, it rlly simple a metadata tag is personally one of the best ways to make a gui in skript simple easy to use plus i can make clicking stuff open diff guis

coral summit
manic sonnet
#

lmfao

coral summit
#

They say we can so

manic sonnet
#

cool thing amount metadata tags is you can do smh like open metadata tag gui to player (aint working code) to be able to open the gui anywhere

#

& once u open it once with a cmd it will just always be set to the code items u set it to