1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Skript' started by Goose, Dec 22, 2019.

Tags:
Thread Status:
Not open for further replies.
  1. Goose

    Supporter

    Joined:
    Nov 23, 2019
    Messages:
    429
    Likes Received:
    30
    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 (Text):
    1. # GUILDS YEET# #Skript by The Goose#1832#
    2. command /clan (create|disband|leave|addtag|deltag|promote|demote|invite|join) [<text>]:
    3.     permission: clan.use
    4.     permission message: &cHonk! You do not have permission to use this command.
    5.     aliases: /c, /guild, /g
    6.     trigger:
    7.         if arg-1 is "create":
    8.             if arg-2 is not set:
    9.                 send "&cPut in the name that you want your new guild/clan to be!"
    10.             if arg-2 is set:
    11.                 add arg-2 to {clans::*}
    12.                 set {clanname.%player's uuid%} to arg-2
    ERROR:
    Code (Text):
    1. 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)
    2.  
    3. 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)
     
  2. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    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.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...