Solved TuSKe GUI stops working

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

KingDooms

Member
Jun 10, 2020
26
0
1
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:
options:
    BlankModifier: &c&lModifier: &c&lNONE
    Modifier1: &c&lModifier: &7&lS l o w
    Modifier2: &c&lModifier: &8&lDamaged
    Modifier3: &c&lModifier: &b&lFast
    Modifier4: &c&lModifier: &a&lSpiky
    Modifier5: &c&lModifier: &f&lAxe Form


command /tuskegui:
    trigger:
        clear {ForgeItem2::%player%}
        open virtual chest inventory with size 3 named "&0&lThe Forge" to player
        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:
            cancel event
        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:
            if {ForgeItem2::%player%} is set:
                if 3rd line of lore of {ForgeItem2::%player%} contains "{@BlankModifier}" or "{@Modifier1}" or "{@Modifier2}" or "{@Modifier3}" or "{@Modifier4}" or "{@Modifier5}":
                    set {_forgechance} to a random integer between 1 and 5
                    if {_forgechance} is 1:
                        set the 3rd line of lore of {ForgeItem2::%player%} to "{@Modifier1}"
                    if {_forgechance} is 2:
                        set the 3rd line of lore of {ForgeItem2::%player%} to "{@Modifier2}"
                    if {_forgechance} is 3:
                        set the 3rd line of lore of {ForgeItem2::%player%} to "{@Modifier3}"
                    if {_forgechance} is 4:
                        set the 3rd line of lore of {ForgeItem2::%player%} to "{@Modifier4}"
                    if {_forgechance} is 5:
                        set the 3rd line of lore of {ForgeItem2::%player%} to "{@Modifier5}"
                    set slot 11 of current inventory of player to {ForgeItem2::%player%}
            else:
                cancel event
        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:
            if {ForgeItem2::%player%} is set:
                if 3rd line of lore of {ForgeItem2::%player%} contains "{@BlankModifier}" or "{@Modifier1}" or "{@Modifier2}" or "{@Modifier3}" or "{@Modifier4}" or "{@Modifier5}":
                    set the 3rd line of lore of {ForgeItem2::%player%} to "{@BlankModifier}"
                    set slot 11 of current inventory of player to {ForgeItem2::%player%}
                    send "&c&l[&6&lFORGE&c&l] &7Modifier has been reset!" to player
            else:
                cancel event



on inventory click:
    if inventory name of player's current inventory is "&0&lThe Forge":
        if clicked inventory is player's inventory:
            if clicked item is {ForgeItem2::%player%}:
                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
                cancel event
            if {ForgeItem2::%player%} is not set:
                set {ForgeItem2::%player%} to clicked item
                set slot 11 of current inventory of player to {ForgeItem2::%player%}
                remove {ForgeItem2::%player%} from player's inventory
            if {ForgeItem2::%player%} is set:
                give player {ForgeItem2::%player%}
                set {ForgeItem2::%player%} to clicked item
                set slot 11 of current inventory of player to {ForgeItem2::%player%}
                remove {ForgeItem2::%player%} from player's inventory
        else:
            if index of event-slot = 11:
                give player {ForgeItem2::%player%}
                clear {ForgeItem2::%player%}
                set slot 11 of current inventory of player to air



on inventory close:
    if inventory name of player's current inventory is "&0&lThe Forge":
        if {ForgeItem2::%player%} is set:
            give player {ForgeItem2::%player%}
            clear {ForgeItem2::%player%}
 
Last edited:
Status
Not open for further replies.