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.

inventory GUI

Discussion in 'Skript' started by Qurao, Jul 18, 2020.

Tags:
Thread Status:
Not open for further replies.
  1. Qurao

    Qurao New Member

    Joined:
    Jul 10, 2020
    Messages:
    7
    Likes Received:
    0
    I have a code, but it doesn't work and gives an error:


    [15:36:04 ERROR]: [Skript] In 1.13+ you cannot get the title name of an inventory outside of an InventoryClickEvent, Only if this inventory has an InventoryHolder may it be used in this state.



    Code:


    on rightclick on player:
    if {rpname.%clicked entity%} is set:
    if player is sneaking:
    open chest with 1 row named "&c%{rpname.%clicked entity%}%" to player
    set {gui.%player%} to "%clicked entity%"
    wait 1 tick
    set slot 0 of player's current inventory to player head named "&9Описание игрока"
    set slot 1 of player's current inventory to gold nugget named "&9Торговля"
    set slot 2 of player's current inventory to chest named "&9Посмотреть инвентарь игрока"
    set slot 3 of player's current inventory to gold ingot named "&9Посмотреть денежное состояние игрока"
    set slot 4 of player's current inventory to gold block named "&9Передать деньги игроку"
    else:
    send "§6%{rpname.%clicked entity%}%:§3%{rpdesc.%clicked entity%}%" to player
    on inventory click:
    if inventory name of player's current inventory is {gui.%player%}:
    if clicked slot is 0:
    close inventory of player
    execute player command "/card %{gui.%player%}%"
    if clicked slot is 1:
    close inventory of player
    execute player command "/trade %{gui.%player%}%"
    if clicked slot is 2:
    close inventory of player
    execute player command "/steal %{gui.%player%}%"
    if clicked slot is 3:
    close inventory of player
    execute player command "/checkbal %{gui.%player%}%"
    if clicked slot is 4:
    close inventory of player
    send "Для передачи денег игроку используйте команду /pay <Денежная сумма> %{gui.%player%}%"
     
  2. FusionCore

    Supporter

    Joined:
    Apr 19, 2020
    Messages:
    44
    Likes Received:
    1
    Please click the plus button when making a topic/reply and click code.
    Then I can see the indenting and it will make it easier for me to help you.
     
  3. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    Although, in the parser your code do not get an error, try this:
    Code (Skript):
    1. on inventory click:
    2.     if "%event.getView().getTitle()%" = {gui.%player%}:
    3.         if clicked slot is 0:
    4.             close inventory of player
    5.             execute player command "/card %{gui.%player%}%"
    6.         if clicked slot is 1:
    7.             close inventory of player
    8.             execute player command "/trade %{gui.%player%}%"
    9.         if clicked slot is 2:
    10.             close inventory of player
    11.             execute player command "/steal %{gui.%player%}%"
    12.         if clicked slot is 3:
    13.             close inventory of player
    14.             execute player command "/checkbal %{gui.%player%}%"
    15.         if clicked slot is 4:
    16.             close inventory of player
    17.             send "Для передачи денег игроку используйте команду /pay <Денежная сумма> %{gui.%player%}%"
    You need skript-mirror to do this.
    --- Double Post Merged, Jul 19, 2020, Original Post Date: Jul 19, 2020 ---
    And can you send a screenshot of the error directly?
     
  4. Qurao

    Qurao New Member

    Joined:
    Jul 10, 2020
    Messages:
    7
    Likes Received:
    0
    I tried to upload skript-mirror to the server, but as I understand it does not support 1.15.2. I am using Paper 1.15.2.

    Error while loading the server (appears very many times):


    [12:57:52] [Server thread/ERROR]: [Skript] 1 log handler was not stopped properly! (at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1501)) [if you're a server admin and you see this message please file a bug report at https://github.com/bensku/skript/issues if there is not already one]
    --- Double Post Merged, Jul 19, 2020 ---
    Of course the error code is:
    [​IMG]
     
  5. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    From what you tell me, then the problem would be the version you use. Or if this is not the error, it could be the value of the variable (%clicked entity%) at the time you check the inventory name.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...