Solved Help with if arg-1 is ""

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

gamikos

Member
Dec 2, 2020
1
1
3
17
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.
 
  • Like
Reactions: acai
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.
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)
 
You must continue the chain of "else". For example:
Code:
command /do [<text>]:
  permission: blahblahblah.procrastination
  trigger:
    if arg-1 is "argumentoneedition":
      do this
    else:
      if arg-1 is "argumenttwoedition":
        do this too
      else:
        if arg-1 is "argumentthreeedition":
          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:
 
Last edited:
Code:
if arg 1 is "lapis":
                if the player's inventory doesn't have space for diamond:
                        send "&7[&4&l!&7] &c&lYou don't have enough space in Your Inventory!"
                        stop
                if player's balance is more than 45:
                        remove 45 from player's balance
                        send "&7[&2&l✓&7] &2Successfully Bought &9 16x Lapisu"
                        add 16 lapis lazuli to player's inventory
                        stop
you put if the player's inventory doesnt have space for diamond? is this a typo lol?
 
Code:
if arg 1 is "lapis":
                if the player's inventory doesn't have space for diamond:
                        send "&7[&4&l!&7] &c&lYou don't have enough space in Your Inventory!"
                        stop
                if player's balance is more than 45:
                        remove 45 from player's balance
                        send "&7[&2&l✓&7] &2Successfully Bought &9 16x Lapisu"
                        add 16 lapis lazuli to player's inventory
                        stop
you put if the player's inventory doesnt have space for diamond? is this a typo lol?

im pretty sure its just that he didnt read the docs beforehand :emoji_stuck_out_tongue:
 
Status
Not open for further replies.