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.

Solved Help with if arg-1 is ""

Discussion in 'Skript' started by gamikos, Dec 3, 2020.

Thread Status:
Not open for further replies.
  1. gamikos

    gamikos Member

    Joined:
    Dec 2, 2020
    Messages:
    1
    Likes Received:
    1
    Hello, I'm new to This Forum and the Skript itself. Today I ran into weird issue with my command. There are no errors. But it just doesn't work as It should.

    The command should work like that:
    /buy lapis
    *Gives lapis to the player*
    /buy diamond
    *Gives diamond to the player*

    But the problem here is that. When I type /buy lapis, It still gives me diamonds. It just won't reach the arg-1 "lapis". Only the first argument. Diamond

    Here's the code: https://gamicos667.xyz/cdn/buy.sk (since I don't how to put it here :emoji_grimacing: )

    Any help is very appreciated! Ty.
     
    acai likes this.
  2. BadName

    BadName Member

    Joined:
    Oct 23, 2020
    Messages:
    23
    Likes Received:
    0
    when I tried the skript it came up with 5 errors, are you using an add-on?
    (also all of the inventory space checking things say diamond)
     
  3. acai

    acai Active Member

    Joined:
    Oct 23, 2020
    Messages:
    89
    Likes Received:
    1
    You must continue the chain of "else". For example:
    Code (Text):
    1. command /do [<text>]:
    2.   permission: blahblahblah.procrastination
    3.   trigger:
    4.     if arg-1 is "argumentoneedition":
    5.       do this
    6.     else:
    7.       if arg-1 is "argumenttwoedition":
    8.         do this too
    9.       else:
    10.         if arg-1 is "argumentthreeedition":
    11.           do this as well
    sorry I don't use tabs, I prefer soft, minimalist spacing
    you can also use "else if" and then an event if you want to save spacing :emoji_grinning:
     
    #3 acai, Dec 3, 2020
    Last edited: Dec 4, 2020
  4. Marc

    Marc Active Member

    Joined:
    Nov 27, 2020
    Messages:
    94
    Likes Received:
    0
    Code (Text):
    1. if arg 1 is "lapis":
    2.                 if the player's inventory doesn't have space for diamond:
    3.                         send "&7[&4&l!&7] &c&lYou don't have enough space in Your Inventory!"
    4.                         stop
    5.                 if player's balance is more than 45:
    6.                         remove 45 from player's balance
    7.                         send "&7[&2&l✓&7] &2Successfully Bought &9 16x Lapisu"
    8.                         add 16 lapis lazuli to player's inventory
    9.                         stop
    you put if the player's inventory doesnt have space for diamond? is this a typo lol?
     
  5. acai

    acai Active Member

    Joined:
    Oct 23, 2020
    Messages:
    89
    Likes Received:
    1
    im pretty sure its just that he didnt read the docs beforehand :emoji_stuck_out_tongue:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...