1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved gui help

Discussion in 'Skript' started by VoidOfCatastrophe, Mar 2, 2021.

Thread Status:
Not open for further replies.
  1. VoidOfCatastrophe

    Joined:
    Feb 10, 2021
    Messages:
    18
    Likes Received:
    0
    1. Script Version: 2.3.5
    2. Script Author: bensku
    3. Minecraft Version: 1.16.4
    4. Full Code:
    5. command /punish <player>:
      trigger:
      set metadata tag "BanInvMeta01" of player to chest inventory with 1 row named "&8Punish"
      set slot 4 of metadata tag "BanInvMeta01" of player to arg 1's head named "%arg-1%" with lore "&c&lPick their punishment"
      open (metadata tag "BanInvMeta01" of player) to player
      send "&6Pick who u wanna &c&lPunish!" to player
      set {argument.var} to "arg 1"

      on inventory click:
      event-inventory = (metadata tag "BanInvMeta01" of player):
      index of event-slot = 4:
      cancel event
      set metadata tag "BanInv2Meta01" of player to chest inventory with 3 row named "&8Pick the punishment"
      set slot 13 of metadata tag "BanInv2Meta01" of player to {argument.var}'s head named "%{argument.var}%" with lore "test"
      open (metadata tag "BanInv2Meta01" of player) to player



    6. Errors on Reload:

    7. no error just doesnt work

    8. Console Errors: (if applicable)
    9. no errors

    10. Other Useful Info:

    11. Addons using (including versions):
    12. erzats skdragon tuske
    13. Troubleshooting:

    14. Have you tried searching the docs? yes
      [*]Have you tried searching the Forums? yes
      [*]What other methods have you tried to fix it?
    15. replacing some of the code
     
  2. Xgod2205

    Xgod2205 Member

    Joined:
    Feb 25, 2021
    Messages:
    17
    Likes Received:
    0
    i would recommend using

    open a chest with 3 rows named "your name"
    format slot 1 of player with grass block named "Your name" to close then run "your command"

    then you dont need to use on inventory click
     
  3. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    When writing code, be sure to write it within the code format.

    Leaving that aside, you have to look at some basic errors in your script. For example:
    Code (Skript):
    1. set {argument.var} to "arg 1"
    Change it to:
    Code (Skript):
    1. set {argument.var.%player%} to arg 1
    So that should set the variable {argument.var.%player%} with the player's name at the head of argument 1.

    Code (Skript):
    1. set slot 13 of metadata tag "BanInv2Meta01" of player to {argument.var.%player%}'s head named "%{argument.var.%player%}%" with lore "Test"
     
  4. VoidOfCatastrophe

    Joined:
    Feb 10, 2021
    Messages:
    18
    Likes Received:
    0
    k
    --- Double Post Merged, Mar 3, 2021, Original Post Date: Mar 3, 2021 ---
    command /punish <player>:
    trigger:
    set metadata tag "BanInvMeta01" of player to chest inventory with 1 row named "&8Punish"
    set slot 4 of metadata tag "BanInvMeta01" of player to arg 1's head named "%arg-1%" with lore "&c&lPick their punishment"
    open (metadata tag "BanInvMeta01" of player) to player
    send "&6Pick who u wanna &c&lPunish!" to player
    set {argument.var} to arg 1

    on inventory click:
    event-inventory = (metadata tag "BanInvMeta01" of player):
    index of event-slot = 4:
    cancel event
    set metadata tag "BanInv2Meta01" of player to chest inventory with 3 row named "&8Pick the punishment"
    set slot 13 of metadata tag "BanInv2Meta01" of player to {argument.var.%player%}'s head named "%{argument.var.%player%}%" with lore "Test"
    open (metadata tag "BanInv2Meta01" of player) to player
    Code (Text):
    1. command /punish <player>:
    2.     trigger:
    3.         set metadata tag "BanInvMeta01" of player to chest inventory with 1 row named "&8Punish"
    4.         set slot 4 of metadata tag "BanInvMeta01" of player to arg 1's head named "%arg-1%" with lore "&c&lPick their punishment"
    5.         open (metadata tag "BanInvMeta01" of player) to player
    6.         send "&6Pick who u wanna &c&lPunish!" to player
    7.         set {argument.var} to arg 1
    8.  
    9. on inventory click:
    10.     event-inventory = (metadata tag "BanInvMeta01" of player):
    11.         index of event-slot = 4:
    12.             cancel event
    13.             set metadata tag "BanInv2Meta01" of player to chest inventory with 3 row named "&8Pick the punishment"
    14.             set slot 13 of metadata tag "BanInv2Meta01" of player to {argument.var.%player%}'s head named "%{argument.var.%player%}%" with lore "Test"
    15.             open (metadata tag "BanInv2Meta01" of player) to player
    16.  
    17. it doesnt give a message but it wont appear
    --- Double Post Merged, Mar 4, 2021 ---
    dont mind it not being a .%player% i fixed it but it still doesnt work
    --- Double Post Merged, Mar 4, 2021 ---
    alright. alright. u dont need to reply i fixed some simple errors and it worked.
     
  5. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    If you fixed your problem, mark the thread as solved.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...