Remove specific variable

  • 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 community!

    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.

kasper227232

Member
Feb 25, 2017
14
0
0
Hello SkUnity!

I'm having some trouble, I'm currently creating a report system, but I want it so when I click one of the reports in the GUI the report will be deleted.

I can't seem to figure out how to do so, anyone that can help?

code_language.skript:
command /report [<text>] <player> [<text>]:
    permission: {@permission}.report
    usage: &c/report <player> <reason>
    trigger:
        if arg 1 is "check":
            if arg 2 is set:
                loop all players:
                    if loop-player has permission "{@permission}.report.check":
                        open chest with 6 rows named "&cReport" to player
                        wait 1 tick
                        loop integers between 0 to 53:
                            {_reports::%arg 2%::%loop-number +1%} is set
                            set slot loop-number of player's current inventory to paper named "&f%arg 2% &cReport %loop-number +1%" with lore "&eReason: &c%{_reports::%arg 2%::%loop-number +1%}% ||&eReported by: &c%{_reports::%arg 2%::by::%loop-number +1%}%"
 
You should do something like:
code_language.skript:
set slot loop-number of player's current inventory to paper named "&f%arg 2% &cReport %loop-number +1%" with lore "&eReason: ..." to close then run [make player execute command "/delete %{_reports::%arg 2%::%loop-number +1%}%"]
                           
command /delete [<text>] [<text>]:
    trigger:
        remove arg 1 from  {_reports::%arg 2%}

It`s example don`t work

You need to click on the item to execute another command that is responsible for deleting the user's report
 
You should do something like:
code_language.skript:
set slot loop-number of player's current inventory to paper named "&f%arg 2% &cReport %loop-number +1%" with lore "&eReason: ..." to close then run [make player execute command "/delete %{_reports::%arg 2%::%loop-number +1%}%"]
                          
command /delete [<text>] [<text>]:
    trigger:
        remove arg 1 from  {_reports::%arg 2%}

It`s example don`t work

You need to click on the item to execute another command that is responsible for deleting the user's report
That's not even close to correct. For one, you're using set slot wrong -- you are trying to use format slot. Second, even if you had used format slot right format slot should never be used. Third, the command won't even function correctly. The best way to do with would be using a tuske advanced gui.
 
Hello SkUnity!

I'm having some trouble, I'm currently creating a report system, but I want it so when I click one of the reports in the GUI the report will be deleted.

I can't seem to figure out how to do so, anyone that can help?

code_language.skript:
command /report [<text>] <player> [<text>]:
    permission: {@permission}.report
    usage: &c/report <player> <reason>
    trigger:
        if arg 1 is "check":
            if arg 2 is set:
                loop all players:
                    if loop-player has permission "{@permission}.report.check":
                        open chest with 6 rows named "&cReport" to player
                        wait 1 tick
                        loop integers between 0 to 53:
                            {_reports::%arg 2%::%loop-number +1%} is set
                            set slot loop-number of player's current inventory to paper named "&f%arg 2% &cReport %loop-number +1%" with lore "&eReason: &c%{_reports::%arg 2%::%loop-number +1%}% ||&eReported by: &c%{_reports::%arg 2%::by::%loop-number +1%}%"
That's not even close to correct. For one, you're using set slot wrong -- you are trying to use format slot. Second, even if you had used format slot right format slot should never be used. Third, the command won't even function correctly. The best way to do with would be using a tuske advanced gui.
code_language.skript:
command /report [<text>] <player> [<text>]:
    trigger:
        create a gui with virtual chest with 6 rows named "&cReport":
            loop 53 times:
                {_reports::%arg 2%::%loop-number%} is set:
                    make next gui slot with Stone named "&f%arg 2% &cReport %loop-number%" with lore "&eReason: &c%{_reports::%arg 2%::%loop-number%}% ||&eReported by: &c%{_reports::%arg 2%::by::%loop-number%}%"
        open last gui to player
p.s. i am using this wiki page
 
Status
Not open for further replies.