Solved Clicked slot not running and I don't know what more to do!

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

KroterPvP

Active Member
Apr 10, 2017
178
7
18
22
Hello. I'm working to create a ban system. Now, I'm doing the GUI's where are shown only banned players. The gui is perfectly created. I'm using the event "on inventory click", and then check "if clicked slot is x". The clicked slot event is not working.

Skript Version: Skript 2.2-dev27
Skript Author: Bensku
Minecraft Version: 1.8.8
Addons I'm using: SkQuerry 3
I have tried searching the docs, and I found nothing.
I've also tried to search in the forums. I've created a thread 3 weeks ago, and nobody helped me. They said I should use Benskus edit's skript, but it's what I'm using...
What other methods have you tried to fix it? I have tried to downgrade my Skript version and still doesn't work.
Skript code:
code_language.skript:
command /bans:
    trigger:
        player has permission "sb.bans":
            open chest with 6 rows named "&0List of banned players" to player
            set slot 45 of player's current inventory to book named "&eMain Page"
            set slot 46 of player's current inventory to black stained glass pane named "&7"
            set slot 47 of player's current inventory to black stained glass pane named "&7"
            set slot 48 of player's current inventory to black stained glass pane named "&7"
            set slot 49 of player's current inventory to anvil named "&eSearch players" with lore "||&7Click here to &csearch &7banned players.||&7An anvil gui where you can write the||&7player's name will apear."
            set slot 50 of player's current inventory to black stained glass pane named "&7"
            set slot 51 of player's current inventory to black stained glass pane named "&7"
            set slot 52 of player's current inventory to black stained glass pane named "&7"
            set slot 53 of player's current inventory to arrow named "&eNext Page"
            set {_slot} to 0
            wait 1 tick
            loop {bans::*}:
                if {_slot} is less than 45:
                    wait 0.5 ticks
                    set slot {_slot} of player's current inventory to loop-value's skull named "&7Player &8» &c%loop-value% &7(&c##%loop-index%&7)." with lore "||&7Is Banned &8» &c%{banned.%loop-value%}%&7.||&7Banned by &8» &c%{ban.bannedby.%loop-value%}%&7.||&7Ban reason &8» &c%{ban.reason.%loop-value%}%&7.||&7Banned on &8» &c%{ban.time.%loop-value%}%&7.||&7"
                    add 1 to {_slot}
        else if player doesn't have permission "sb.bans":
            send "&8[&c&lBANS&8] &cYou don't have permission to do this!"
on inventory click:
    if name of player's current inventory is "&0List of banned players":
        cancel event
        if clicked slot is 54:
            set {_slot} to 0
            loop 44 times:
                set slot {_slot} of player's current inventory to air
                add 1 to {_slot}
            set {_slot} to 0
            loop {bans::*}:
                if {_slot} is less than 45:
                    wait 0.5 ticks
                    set slot {_slot} of player's current inventory to loop-value's skull named "&7Player &8» &c%loop-value% &7(&c##%loop-index%&7)." with lore "||&7Is Banned &8» &c%{banned.%loop-value%}%&7.||&7Banned by &8» &c%{ban.bannedby.%loop-value%}%&7.||&7Ban reason &8» &c%{ban.reason.%loop-value%}%&7.||&7Banned on &8» &c%{ban.time.%loop-value%}%&7.||&7"
                    add 1 to {_slot}
        else if clicked slot is 45:
            close player's inventory
            execute player command "/bans"
        if clicked slot is 49:
            close player's inventory
            set {bans.chat::%player%} to true
            send "&8[&c&lBANS&8] &7You must write the player's name in chat. Type &ccancel &7to annullate the search."
on chat:
    if {bans.chat::%player%} is true:
        cancel event
        set {_search} to "%message%" parsed as offline player
        if {_search} is "cancel":
            delete {bans.chat::%player%}
            send "&8[&c&lBANS&8] &7You have succesfully annullated the search."
        else:
            if {banned.%{_search}%} is true:
                send "&8[&c&lBANS&8] &a%{_search}% &7is banned."
                send "Open gui"
            else if {banned.%{_search}%} is not true:
                send "&8[&c&lBANS&8] &a%{_search}% &7is not banned."
            delete {bans.chat::%player%}
Errors loading this skript:
code_language.skript:
Can't compare 'clicked slot' with an integer (skript.sk, line 182: if clicked slot is 54:')
'else if' has to be placed just after another 'if' or 'else if' section (skript.sk, line 193: else if clicked slot is 45:')
Can't compare 'clicked slot' with an integer (skript.sk, line 196: if clicked slot is 49:')

I've already created this thread 2 weeks ago, and we could not fix it.
[doublepost=1498484206,1498482032][/doublepost]EDIT: Finally, I could fix it!

How? Using Skellet!
 
Status
Not open for further replies.