Solved Could not pass InventoryClickEvent

  • 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.

JaydenBee

Member
Nov 11, 2019
36
2
8
22
strawberry fields
So I have this profile selection menu that i'm working on.
There's a problem with my "Profile Management" GUI.
Since Skript is the most buggy and underdeveloped plugin in existance, it can't do what normal languages do, and instead throws an error at you and expects you to understand wtf is happening.

Code:
command /profiles:
   trigger:
      open virtual chest inventory with size 1 named "Profile Selection" to player
      format gui slot (all integers between 0 and 8) of player with light gray stained glass pane named " "
      format gui slot 3 of player with shiny book named "&a%{p1name.%player's uuid%}% &a(Current)" with lore "&aKills&f: %{p1kills.%player's uuid%}%", "&cDeaths&f: %{p1deaths.%player's uuid%}%" and "&bMoney&f: %{p1bal.%player's uuid%}%"
      if {profiles.%player's uuid%} is 1:
         format gui slot 5 of player with barrier named "&aCreate a new profile!" to run function newProfile(player)
      else if {profiles.%player's uuid%} is 2:
         if {pint.%player's uuid%} is 1:       
            format gui slot 5 of player with book named "&cProfile 2" with lore "&aKills&f: %{p2kills.%player's uuid%}%", "&cDeaths&f: %{p2deaths.%player's uuid%}%" and "&bMoney&f: %{p2bal.%player's uuid%}%" to run function manage2(player)
         else if {pint.%player's uuid%} is 2:
            format gui slot 3 of player with book named "&cProfile 1" with lore "&aKills&f: %{p1kills.%player's uuid%}%", "&cDeaths&f: %{p1deaths.%player's uuid%}%" and "&bMoney&f: %{p1bal.%player's uuid%}%" to run function profile1(player)
            format gui slot 5 of player with shiny book named "&aProfile 2 &a(Current)" with lore "&aKills&f: %{p2kills.%player's uuid%}%", "&cDeaths&f: %{p2deaths.%player's uuid%}%" and "&bMoney&f: %{p2bal.%player's uuid%}%" 
        
function profile1(p: player):
   set {_pu} to uuid of {_p}
   set {pint.%{_pu}%} to 1
   delete {p2inventory.%{_pu}%::*}
   loop all items in {_p}'s inventory:
      add loop-item to {p2inventory.%{_pu}%::*}
   clear {_p}'s inventory
   add {p1inventory.%{_pu}%::*} to {_p}'s inventory
   close {_p}'s inventory
   kill {_p}

function profile2(p: player):
   set {_pu} to uuid of {_p}
   set {pint.%{_pu}%} to 2 
   delete {p1inventory.%{_pu}%::*}
   loop all items in {_p}'s inventory:
      add loop-item to {p1inventory.%{_pu}%::*}
   clear {_p}'s inventory
   add {p2inventory.%{_pu}%::*} to {_p}'s inventory
   close {_p}'s inventory
   kill {_p}

function manage2(p: player):
   close {_p}'s inventory
   open virtual chest inventory with size 1 named "Profile Management" to {_p}
   format gui slot (all integers between 0 and 8) of {_p} with light gray stained glass pane named " "
   format gui slot 2 of {_p} with paper named "&aSwitch to profile" to run function profile2(%{_p}%)
   format gui slot 4 of {_p} with birch sign named "&eGo Back" to close then run {_p} command "/profiles"
   format gui slot 6 of {_p} with barrier named "&cDelete profile" with lore "&4WARNING: THERE IS NO CONFIRMATION", "&4AS SOON AS YOU CLICK THIS YOUR" and "&4PROFILE IS DELETED" to run function delP2(%{_p}%)

function delP2(p: player):
   set {_u} to {_p}'s uuid
   send "&cDeleting profile!" to {_p}
   delete {p2inventory.%{_u}%::*}
   set {profiles.%{_u}%} to 1
   close {_p}'s inventory
   send title "&aProfile succesfully deleted!" to {_p}

function newProfile(p: player):
   send "&7Making some space..." to {_p}
   set {_pu} to uuid of {_p}
   loop all items in {_p}'s inventory:
      add loop-item to {p1inventory.%{_pu}%::*}
   clear {_p}'s inventory
   send "&7Creating profile..." to {_p}
   set {profiles.%{_pu}%} to 2
   set {pint.%{_pu}%} to 2   
   close {_p}'s inventory
   kill {_p}
   send "&7Profile created!" to {_p}

The manage2 and del2P functions are the problem.

Dunno what's happening.

[Mon, 16. Mar 2020 02:11:48 GMT INFO] ADMIN bear_attack_man | Elite Hawk: gucci gang [Mon, 16. Mar 2020 02:11:51 GMT INFO] bear_attack_man issued server command: /profiles [Mon, 16. Mar 2020 02:11:51 GMT INFO] bear_attack_man c8d10-f19f-420a-9a3d-faf8460f3757]: /profiles

[3:11 PM]
[Mon, 16. Mar 2020 02:11:54 GMT ERROR] Could not pass event InventoryClickEvent to Skript v2.4.1-MH [Mon, 16. Mar 2020 02:11:55 GMT ERROR] Could not pass event InventoryClickEvent to Skript v2.4.1-MH [Mon, 16. Mar 2020 02:11:56 GMT INFO] bear_attack_man c8d10-f19f-420a-9a3d-faf8460f3757]: /profiles
 
So I have this profile selection menu that i'm working on.
There's a problem with my "Profile Management" GUI.
Since Skript is the most buggy and underdeveloped plugin in existance, it can't do what normal languages do, and instead throws an error at you and expects you to understand wtf is happening.

Code:
command /profiles:
   trigger:
      open virtual chest inventory with size 1 named "Profile Selection" to player
      format gui slot (all integers between 0 and 8) of player with light gray stained glass pane named " "
      format gui slot 3 of player with shiny book named "&a%{p1name.%player's uuid%}% &a(Current)" with lore "&aKills&f: %{p1kills.%player's uuid%}%", "&cDeaths&f: %{p1deaths.%player's uuid%}%" and "&bMoney&f: %{p1bal.%player's uuid%}%"
      if {profiles.%player's uuid%} is 1:
         format gui slot 5 of player with barrier named "&aCreate a new profile!" to run function newProfile(player)
      else if {profiles.%player's uuid%} is 2:
         if {pint.%player's uuid%} is 1:      
            format gui slot 5 of player with book named "&cProfile 2" with lore "&aKills&f: %{p2kills.%player's uuid%}%", "&cDeaths&f: %{p2deaths.%player's uuid%}%" and "&bMoney&f: %{p2bal.%player's uuid%}%" to run function manage2(player)
         else if {pint.%player's uuid%} is 2:
            format gui slot 3 of player with book named "&cProfile 1" with lore "&aKills&f: %{p1kills.%player's uuid%}%", "&cDeaths&f: %{p1deaths.%player's uuid%}%" and "&bMoney&f: %{p1bal.%player's uuid%}%" to run function profile1(player)
            format gui slot 5 of player with shiny book named "&aProfile 2 &a(Current)" with lore "&aKills&f: %{p2kills.%player's uuid%}%", "&cDeaths&f: %{p2deaths.%player's uuid%}%" and "&bMoney&f: %{p2bal.%player's uuid%}%"
       
function profile1(p: player):
   set {_pu} to uuid of {_p}
   set {pint.%{_pu}%} to 1
   delete {p2inventory.%{_pu}%::*}
   loop all items in {_p}'s inventory:
      add loop-item to {p2inventory.%{_pu}%::*}
   clear {_p}'s inventory
   add {p1inventory.%{_pu}%::*} to {_p}'s inventory
   close {_p}'s inventory
   kill {_p}

function profile2(p: player):
   set {_pu} to uuid of {_p}
   set {pint.%{_pu}%} to 2
   delete {p1inventory.%{_pu}%::*}
   loop all items in {_p}'s inventory:
      add loop-item to {p1inventory.%{_pu}%::*}
   clear {_p}'s inventory
   add {p2inventory.%{_pu}%::*} to {_p}'s inventory
   close {_p}'s inventory
   kill {_p}

function manage2(p: player):
   close {_p}'s inventory
   open virtual chest inventory with size 1 named "Profile Management" to {_p}
   format gui slot (all integers between 0 and 8) of {_p} with light gray stained glass pane named " "
   format gui slot 2 of {_p} with paper named "&aSwitch to profile" to run function profile2(%{_p}%)
   format gui slot 4 of {_p} with birch sign named "&eGo Back" to close then run {_p} command "/profiles"
   format gui slot 6 of {_p} with barrier named "&cDelete profile" with lore "&4WARNING: THERE IS NO CONFIRMATION", "&4AS SOON AS YOU CLICK THIS YOUR" and "&4PROFILE IS DELETED" to run function delP2(%{_p}%)

function delP2(p: player):
   set {_u} to {_p}'s uuid
   send "&cDeleting profile!" to {_p}
   delete {p2inventory.%{_u}%::*}
   set {profiles.%{_u}%} to 1
   close {_p}'s inventory
   send title "&aProfile succesfully deleted!" to {_p}

function newProfile(p: player):
   send "&7Making some space..." to {_p}
   set {_pu} to uuid of {_p}
   loop all items in {_p}'s inventory:
      add loop-item to {p1inventory.%{_pu}%::*}
   clear {_p}'s inventory
   send "&7Creating profile..." to {_p}
   set {profiles.%{_pu}%} to 2
   set {pint.%{_pu}%} to 2  
   close {_p}'s inventory
   kill {_p}
   send "&7Profile created!" to {_p}

The manage2 and del2P functions are the problem.

Dunno what's happening.

[Mon, 16. Mar 2020 02:11:48 GMT INFO] ADMIN bear_attack_man | Elite Hawk: gucci gang [Mon, 16. Mar 2020 02:11:51 GMT INFO] bear_attack_man issued server command: /profiles [Mon, 16. Mar 2020 02:11:51 GMT INFO] bear_attack_man c8d10-f19f-420a-9a3d-faf8460f3757]: /profiles

[3:11 PM]
[Mon, 16. Mar 2020 02:11:54 GMT ERROR] Could not pass event InventoryClickEvent to Skript v2.4.1-MH [Mon, 16. Mar 2020 02:11:55 GMT ERROR] Could not pass event InventoryClickEvent to Skript v2.4.1-MH [Mon, 16. Mar 2020 02:11:56 GMT INFO] bear_attack_man c8d10-f19f-420a-9a3d-faf8460f3757]: /profiles

U got full error?
[doublepost=1584357553,1584356542][/doublepost]
So I have this profile selection menu that i'm working on.
There's a problem with my "Profile Management" GUI.
Since Skript is the most buggy and underdeveloped plugin in existance, it can't do what normal languages do, and instead throws an error at you and expects you to understand wtf is happening.

Code:
command /profiles:
   trigger:
      open virtual chest inventory with size 1 named "Profile Selection" to player
      format gui slot (all integers between 0 and 8) of player with light gray stained glass pane named " "
      format gui slot 3 of player with shiny book named "&a%{p1name.%player's uuid%}% &a(Current)" with lore "&aKills&f: %{p1kills.%player's uuid%}%", "&cDeaths&f: %{p1deaths.%player's uuid%}%" and "&bMoney&f: %{p1bal.%player's uuid%}%"
      if {profiles.%player's uuid%} is 1:
         format gui slot 5 of player with barrier named "&aCreate a new profile!" to run function newProfile(player)
      else if {profiles.%player's uuid%} is 2:
         if {pint.%player's uuid%} is 1:      
            format gui slot 5 of player with book named "&cProfile 2" with lore "&aKills&f: %{p2kills.%player's uuid%}%", "&cDeaths&f: %{p2deaths.%player's uuid%}%" and "&bMoney&f: %{p2bal.%player's uuid%}%" to run function manage2(player)
         else if {pint.%player's uuid%} is 2:
            format gui slot 3 of player with book named "&cProfile 1" with lore "&aKills&f: %{p1kills.%player's uuid%}%", "&cDeaths&f: %{p1deaths.%player's uuid%}%" and "&bMoney&f: %{p1bal.%player's uuid%}%" to run function profile1(player)
            format gui slot 5 of player with shiny book named "&aProfile 2 &a(Current)" with lore "&aKills&f: %{p2kills.%player's uuid%}%", "&cDeaths&f: %{p2deaths.%player's uuid%}%" and "&bMoney&f: %{p2bal.%player's uuid%}%"
       
function profile1(p: player):
   set {_pu} to uuid of {_p}
   set {pint.%{_pu}%} to 1
   delete {p2inventory.%{_pu}%::*}
   loop all items in {_p}'s inventory:
      add loop-item to {p2inventory.%{_pu}%::*}
   clear {_p}'s inventory
   add {p1inventory.%{_pu}%::*} to {_p}'s inventory
   close {_p}'s inventory
   kill {_p}

function profile2(p: player):
   set {_pu} to uuid of {_p}
   set {pint.%{_pu}%} to 2
   delete {p1inventory.%{_pu}%::*}
   loop all items in {_p}'s inventory:
      add loop-item to {p1inventory.%{_pu}%::*}
   clear {_p}'s inventory
   add {p2inventory.%{_pu}%::*} to {_p}'s inventory
   close {_p}'s inventory
   kill {_p}

function manage2(p: player):
   close {_p}'s inventory
   open virtual chest inventory with size 1 named "Profile Management" to {_p}
   format gui slot (all integers between 0 and 8) of {_p} with light gray stained glass pane named " "
   format gui slot 2 of {_p} with paper named "&aSwitch to profile" to run function profile2(%{_p}%)
   format gui slot 4 of {_p} with birch sign named "&eGo Back" to close then run {_p} command "/profiles"
   format gui slot 6 of {_p} with barrier named "&cDelete profile" with lore "&4WARNING: THERE IS NO CONFIRMATION", "&4AS SOON AS YOU CLICK THIS YOUR" and "&4PROFILE IS DELETED" to run function delP2(%{_p}%)

function delP2(p: player):
   set {_u} to {_p}'s uuid
   send "&cDeleting profile!" to {_p}
   delete {p2inventory.%{_u}%::*}
   set {profiles.%{_u}%} to 1
   close {_p}'s inventory
   send title "&aProfile succesfully deleted!" to {_p}

function newProfile(p: player):
   send "&7Making some space..." to {_p}
   set {_pu} to uuid of {_p}
   loop all items in {_p}'s inventory:
      add loop-item to {p1inventory.%{_pu}%::*}
   clear {_p}'s inventory
   send "&7Creating profile..." to {_p}
   set {profiles.%{_pu}%} to 2
   set {pint.%{_pu}%} to 2  
   close {_p}'s inventory
   kill {_p}
   send "&7Profile created!" to {_p}

The manage2 and del2P functions are the problem.

Dunno what's happening.

[Mon, 16. Mar 2020 02:11:48 GMT INFO] ADMIN bear_attack_man | Elite Hawk: gucci gang [Mon, 16. Mar 2020 02:11:51 GMT INFO] bear_attack_man issued server command: /profiles [Mon, 16. Mar 2020 02:11:51 GMT INFO] bear_attack_man c8d10-f19f-420a-9a3d-faf8460f3757]: /profiles

[3:11 PM]
[Mon, 16. Mar 2020 02:11:54 GMT ERROR] Could not pass event InventoryClickEvent to Skript v2.4.1-MH [Mon, 16. Mar 2020 02:11:55 GMT ERROR] Could not pass event InventoryClickEvent to Skript v2.4.1-MH [Mon, 16. Mar 2020 02:11:56 GMT INFO] bear_attack_man c8d10-f19f-420a-9a3d-faf8460f3757]: /profiles

Guess i see it:

Code:
format gui slot 4 of {_p} with birch sign named "&eGo Back" to close then run {_p} command "/profiles"

should be:

Code:
format gui slot 4 of {_p} with birch sign named "&eGo Back" to close then run player command "/profiles"
 
he typed too much stuff
Forgot to lock this, also I fixed it by replacing %{_p}% with {_p}.
My guess for what happened is that skript thought it was a type, rather than a variable.
What I mean is this,
upload_2020-3-17_0-23-9.png

You can't have percentages when calling a function :emoji_frowning:.
 
Status
Not open for further replies.