"The command does not have a 2nd argument" error when a 2nd arg is set

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

Goose

Supporter
Nov 23, 2019
439
33
28
Hey guys, I am coding a clan system, and I am getting an error saying that there isn't a 2nd argument in the command when there clearly is. (I am not testing this in Minecraft, I am looking at the parse results in the Skunity Parser)

CODE:
Code:
# GUILDS YEET# #Skript by The Goose#1832#
command /clan (create|disband|leave|addtag|deltag|promote|demote|invite|join) [<text>]:
    permission: clan.use
    permission message: &cHonk! You do not have permission to use this command.
    aliases: /c, /guild, /g
    trigger:
        if arg-1 is "create":
            if arg-2 is not set:
                send "&cPut in the name that you want your new guild/clan to be!"
            if arg-2 is set:
                add arg-2 to {clans::*}
                set {clanname.%player's uuid%} to arg-2

ERROR:
Code:
Line 8: The command doesn't have a 2nd argument (line 10: if arg-2 is not set:') (You're trying to access an argument that hasn't been defined when you registered the command)

Line 10: The command doesn't have a 2nd argument (line 13: if arg-2 is set:') (You're trying to access an argument that hasn't been defined when you registered the command)
 
Hey guys, I am coding a clan system, and I am getting an error saying that there isn't a 2nd argument in the command when there clearly is. (I am not testing this in Minecraft, I am looking at the parse results in the Skunity Parser)

CODE:
Code:
# GUILDS YEET# #Skript by The Goose#1832#
command /clan (create|disband|leave|addtag|deltag|promote|demote|invite|join) [<text>]:
    permission: clan.use
    permission message: &cHonk! You do not have permission to use this command.
    aliases: /c, /guild, /g
    trigger:
        if arg-1 is "create":
            if arg-2 is not set:
                send "&cPut in the name that you want your new guild/clan to be!"
            if arg-2 is set:
                add arg-2 to {clans::*}
                set {clanname.%player's uuid%} to arg-2

ERROR:
Code:
Line 8: The command doesn't have a 2nd argument (line 10: if arg-2 is not set:') (You're trying to access an argument that hasn't been defined when you registered the command)

Line 10: The command doesn't have a 2nd argument (line 13: if arg-2 is set:') (You're trying to access an argument that hasn't been defined when you registered the command)
Your 'first argument' probably doesn't actually count as an argument since it has no type in it. You need to use a string argument, then check if it's one of the possible values, so that Skript recognizes it as an argument.
 
Status
Not open for further replies.