If arg 2 is not set: Broken?

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

GlacialDew

Member
Apr 8, 2018
40
3
8
Norrland
Everytime i use the command without an arg set, it replies with the correct usage.
But I Just want it to send the help messages :/

code_language.skript:
command /lootbox <text> <player>:
    trigger:
        if arg 1 is "help":
            if arg 2 is not set:
                if player has permission "ll.admin":
                    send "&7---&5---&7---[&dLegendary Loot Help&7]---&5---&7---"
                    send "&d/lootbox common (player) &7- Give The Player a &aCommon LootBox"
 
code_language.skript:
command /lootbox [<text>] [<player>]:
    trigger:
        if arg-1 isn't set:
            send "Specify a text [ie: Help]"
        else if arg-2 isn't set:
            send "You must specify a player"
        else if arg-1 is "help":
            if arg-2 isn't set:
                if player has permission "ll.admin":
                    send "&7---&5---&7---[&dLegendary Loot Help&7]---&5---&7---"
                    send "&d/lootbox common (player) &7- Give The Player a &aCommon LootBox"
                else:
                    send "&7---&5---&7---[&dLegendary Loot Help&7]---&5---&7---"
                    send "&d/lootbox &7- Main LootBox Command"
 
You have both arguments marked as required so the command won't go through to your trigger unless you provide both arguments. If you want an argument (in this case, the <player> argument) to be optional, you must wrap it in square brackets, i.e. [<player>].
 
Status
Not open for further replies.