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 TuSKe GUI stops working

Discussion in 'Skript' started by KingDooms, Jul 20, 2021.

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

    KingDooms Member

    Joined:
    Jun 10, 2020
    Messages:
    23
    Likes Received:
    0
    So i was trying out making a TuSKe GUI, but for some reasson, it stopped working and it doesn't cancel event or anything. Everytime i click the gray stained glass pane, it normally cancels event, but nothing, the anvil, also nothing, i can just steal it. But for some reasson the inventory click and inventory close still work. Any help?


    SOLUTION: For some reasson, it was a skript bug, because as soon as I restarted the server, the code started working.



    Code (Text):
    1.  
    2. options:
    3.     BlankModifier: &c&lModifier: &c&lNONE
    4.     Modifier1: &c&lModifier: &7&lS l o w
    5.     Modifier2: &c&lModifier: &8&lDamaged
    6.     Modifier3: &c&lModifier: &b&lFast
    7.     Modifier4: &c&lModifier: &a&lSpiky
    8.     Modifier5: &c&lModifier: &f&lAxe Form
    9.  
    10.  
    11. command /tuskegui:
    12.     trigger:
    13.         clear {ForgeItem2::%player%}
    14.         open virtual chest inventory with size 3 named "&0&lThe Forge" to player
    15.         format gui slot 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9 and 10 and 12 and 13 and 14 and 16 and 17 and 18 and 19 and 20 and 21 and 22 and 23 and 24 and 25 of player with gray stained glass pane named "&r" to run:
    16.             cancel event
    17.         format gui slot 15 of player with anvil named "&a&lThe Forge" with lore "&c&lAdd a weapon that can accept" and "&d&lmodifiers&c&l and it will either" and "&c&lgive a &a&lbuff &c&lor a &4&ldebuff." to run:
    18.             if {ForgeItem2::%player%} is set:
    19.                 if 3rd line of lore of {ForgeItem2::%player%} contains "{@BlankModifier}" or "{@Modifier1}" or "{@Modifier2}" or "{@Modifier3}" or "{@Modifier4}" or "{@Modifier5}":
    20.                     set {_forgechance} to a random integer between 1 and 5
    21.                     if {_forgechance} is 1:
    22.                         set the 3rd line of lore of {ForgeItem2::%player%} to "{@Modifier1}"
    23.                     if {_forgechance} is 2:
    24.                         set the 3rd line of lore of {ForgeItem2::%player%} to "{@Modifier2}"
    25.                     if {_forgechance} is 3:
    26.                         set the 3rd line of lore of {ForgeItem2::%player%} to "{@Modifier3}"
    27.                     if {_forgechance} is 4:
    28.                         set the 3rd line of lore of {ForgeItem2::%player%} to "{@Modifier4}"
    29.                     if {_forgechance} is 5:
    30.                         set the 3rd line of lore of {ForgeItem2::%player%} to "{@Modifier5}"
    31.                     set slot 11 of current inventory of player to {ForgeItem2::%player%}
    32.             else:
    33.                 cancel event
    34.         format gui slot 26 of player with redstone torch named "&r &r &r &4&l --- &c&lReset Modifier &4&l---" with lore "&r &c&l Able to reset the modifier" and "&c&lwhich can be used for trades" to run:
    35.             if {ForgeItem2::%player%} is set:
    36.                 if 3rd line of lore of {ForgeItem2::%player%} contains "{@BlankModifier}" or "{@Modifier1}" or "{@Modifier2}" or "{@Modifier3}" or "{@Modifier4}" or "{@Modifier5}":
    37.                     set the 3rd line of lore of {ForgeItem2::%player%} to "{@BlankModifier}"
    38.                     set slot 11 of current inventory of player to {ForgeItem2::%player%}
    39.                     send "&c&l[&6&lFORGE&c&l] &7Modifier has been reset!" to player
    40.             else:
    41.                 cancel event
    42.  
    43.  
    44.  
    45. on inventory click:
    46.     if inventory name of player's current inventory is "&0&lThe Forge":
    47.         if clicked inventory is player's inventory:
    48.             if clicked item is {ForgeItem2::%player%}:
    49.                 send "&c&l[&6&lFORGE&c&l] &7Due to bugs that could lead to duplication, if you try to click on 2 of the same item, it will not work." to player
    50.                 cancel event
    51.             if {ForgeItem2::%player%} is not set:
    52.                 set {ForgeItem2::%player%} to clicked item
    53.                 set slot 11 of current inventory of player to {ForgeItem2::%player%}
    54.                 remove {ForgeItem2::%player%} from player's inventory
    55.             if {ForgeItem2::%player%} is set:
    56.                 give player {ForgeItem2::%player%}
    57.                 set {ForgeItem2::%player%} to clicked item
    58.                 set slot 11 of current inventory of player to {ForgeItem2::%player%}
    59.                 remove {ForgeItem2::%player%} from player's inventory
    60.         else:
    61.             if index of event-slot = 11:
    62.                 give player {ForgeItem2::%player%}
    63.                 clear {ForgeItem2::%player%}
    64.                 set slot 11 of current inventory of player to air
    65.  
    66.  
    67.  
    68. on inventory close:
    69.     if inventory name of player's current inventory is "&0&lThe Forge":
    70.         if {ForgeItem2::%player%} is set:
    71.             give player {ForgeItem2::%player%}
    72.             clear {ForgeItem2::%player%}
    73.  
     
    #1 KingDooms, Jul 20, 2021
    Last edited: Jul 20, 2021
Thread Status:
Not open for further replies.

Share This Page

Loading...