Help with inventory commands

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

couger44

Supporter
Feb 19, 2017
713
31
28
Chile
Hi, I hope you're having a good day. Well now I will talk to you this doubt I have had for a few hours.

A few minutes ago, I did a /report with GUI, I was going to do that by clicking on the item, execute the command "/report% arg 1% fly (or the item that has clicked to report on the hack). What happens is that I was stuck in one part:
How do I make the executor of the command execute the "report arg 1" command?
I tried (stupidly from me) to put:
code_language.skript:
clicked slot = 9: #It's the feather, and when I click on the feather, what I want is to have it report to argument 1 previously placed as it has seen it fly.
        close player's inventory
        wait a tick
        execute player command "report %arg 1% fly"
Obviously it did not work, and now I have had this question for a long time so I went to the forum. What do I have to do to make it work correctly?
 
Hi, I hope you're having a good day. Well now I will talk to you this doubt I have had for a few hours.

A few minutes ago, I did a /report with GUI, I was going to do that by clicking on the item, execute the command "/report% arg 1% fly (or the item that has clicked to report on the hack). What happens is that I was stuck in one part:
How do I make the executor of the command execute the "report arg 1" command?
I tried (stupidly from me) to put:
code_language.skript:
clicked slot = 9: #It's the feather, and when I click on the feather, what I want is to have it report to argument 1 previously placed as it has seen it fly.
        close player's inventory
        wait a tick
        execute player command "report %arg 1% fly"
Obviously it did not work, and now I have had this question for a long time so I went to the forum. What do I have to do to make it work correctly?
The way you did it, is how you do it. So I'm not sure why its not working for you.
 
I think you have to set a local variable to arg-1, since the code under run from tuske (if that's what you're using) is ran as a seperate event (I think, I'm not sure). Then use that local variable in your command.
 
If you’re using tuske you will have to set a local variable to the arguments before and use that instead. If Ure using inventory click event mixed with Skellett syntax you can’t use aeg-1 since there is no argument
 
If you’re using tuske you will have to set a local variable to the arguments before and use that instead. If Ure using inventory click event mixed with Skellett syntax you can’t use aeg-1 since there is no argument
I'm using the Vanilla inventory.
[doublepost=1554492937,1554492863][/doublepost]The full command code is:
code_language.skript:
command /report [<offline player>] [<text>]:
    trigger:
        if arg 1 is not set:
            if arg 2 is not set:
                send "&c/report <jugador>"
                stop
        else:
            if arg 2 is not set:
                open chest with 4 rows named "&cMenú de reportes." to player
                set slot 0 of player's current inventory to ARG 1'S SKULL named "&cReportar a %arg 1% por:"
                set slot 9 of player's current inventory to FEATHER named "&fVuela(Fly)"
                set slot 10 of player's current inventory to DIAMOND SWORD named "&4KillAura(O parecidos)"
                set slot 11 of player's current inventory to BOW named "&6Aim&fBow &7| &bFast&fBow"
                set slot 12 of player's current inventory to BRICK BLOCK named "&9AutoBuild"
                set slot 13 of player's current inventory to DIAMOND HELMET named "&aAuto&fArmor"
                set slot 14 of player's current inventory to COBWEB named "&fAnti&cKnockback"
                set slot 15 of player's current inventory to COBBLESTONE named "&7Fast&fBreak"
                set slot 16 of player's current inventory to BOOK named "&eOtros..."
                set slot 31 of player's current inventory to 166 named "&c&lCerrar inventario"
                send "&cSi haces reportes falsos serás advertido 3 veces, cuando sobrepases esa cantidad de advertencias, serás baneado por 1 semana."
                stop
            else if arg 2 is set:
                set {_m} to "&aReportado con éxito. Un staff atenderá ese asunto en breves."
                if arg 2 is "fly":
                    add "fly %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "killaura":
                    add "killaura %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "aimbow":
                    add "aimbow %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "autobuild":
                    add "autobuild %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "autoarmor":
                    add "autoarmor %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "antikb":
                    add "antikb %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "fastbreak":
                    add "fastbreak %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "otros":
                    add "Hacker %arg 1%" to {reportes::*}
                    send {_m}
                    stop
 
I'm using the Vanilla inventory.
[doublepost=1554492937,1554492863][/doublepost]The full command code is:
code_language.skript:
command /report [<offline player>] [<text>]:
    trigger:
        if arg 1 is not set:
            if arg 2 is not set:
                send "&c/report <jugador>"
                stop
        else:
            if arg 2 is not set:
                open chest with 4 rows named "&cMenú de reportes." to player
                set slot 0 of player's current inventory to ARG 1'S SKULL named "&cReportar a %arg 1% por:"
                set slot 9 of player's current inventory to FEATHER named "&fVuela(Fly)"
                set slot 10 of player's current inventory to DIAMOND SWORD named "&4KillAura(O parecidos)"
                set slot 11 of player's current inventory to BOW named "&6Aim&fBow &7| &bFast&fBow"
                set slot 12 of player's current inventory to BRICK BLOCK named "&9AutoBuild"
                set slot 13 of player's current inventory to DIAMOND HELMET named "&aAuto&fArmor"
                set slot 14 of player's current inventory to COBWEB named "&fAnti&cKnockback"
                set slot 15 of player's current inventory to COBBLESTONE named "&7Fast&fBreak"
                set slot 16 of player's current inventory to BOOK named "&eOtros..."
                set slot 31 of player's current inventory to 166 named "&c&lCerrar inventario"
                send "&cSi haces reportes falsos serás advertido 3 veces, cuando sobrepases esa cantidad de advertencias, serás baneado por 1 semana."
                stop
            else if arg 2 is set:
                set {_m} to "&aReportado con éxito. Un staff atenderá ese asunto en breves."
                if arg 2 is "fly":
                    add "fly %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "killaura":
                    add "killaura %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "aimbow":
                    add "aimbow %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "autobuild":
                    add "autobuild %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "autoarmor":
                    add "autoarmor %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "antikb":
                    add "antikb %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "fastbreak":
                    add "fastbreak %arg 1%" to {reportes::*}
                    send {_m}
                    stop
                else if arg 2 is "otros":
                    add "Hacker %arg 1%" to {reportes::*}
                    send {_m}
                    stop
you are mixing 3 different plugins together to achieve this. skquery open inventory, skript slot setting and clicked slot is skellet syntax, not skript
 
you are mixing 3 different plugins together to achieve this. skquery open inventory, skript slot setting and clicked slot is skellet syntax, not skript
Ohh... really? I did not notice that. I guess it will be because I have many addons on my server.
 
Status
Not open for further replies.