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.

Compare arg with text

Discussion in 'Skript' started by rwdish, May 11, 2022.

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

    rwdish New Member

    Joined:
    May 8, 2022
    Messages:
    8
    Likes Received:
    0
    Hello! Today i was trying to make a skript to change a person's group on luckperms. I wanted it to be the same command and then an argument that said what to do (Promote, demote, fire, hire).
    Here's what i tried out:

    command /carabinieri [<text>] <player>:
    permission: assumi.carabiniere
    trigger:
    set argument 1 to {func}
    if {func} is "assumi"
    make console execute command "lp user %arg 2% parent set carabiniere"

    The error code i got is "Can't compare "if {func}" with a text. I hope it is clear to everyone

    Thanks!
    -NotRadish
     
  2. Practice

    Practice Member

    Joined:
    Apr 23, 2022
    Messages:
    37
    Likes Received:
    1
    Code (Text):
    1. set {func} to argument 1
    For in-line conditions remove the "if" part
    Code (Text):
    1. {func} is "assumi"
    2. make console execute command "lp user %arg 2% parent set carabiniere"
    or
    Code (Text):
    1. if {func} is "assumi":
    2.     make console execute command "lp user %arg 2% parent set carabiniere"
     
  3. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    145
    Likes Received:
    5
    You can just do this
    Code (Text):
    1. If arg 1 is "example":
    2.     Code
    3.     If arg 2 is set:
    4.         Code
    5.     Else:
    6.         Message "arg 2 is not set"
     
  4. rwdish

    rwdish New Member

    Joined:
    May 8, 2022
    Messages:
    8
    Likes Received:
    0
    Sadly, none of these work. I'm on 1.16.5 and using skript 2.5.
     
  5. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    145
    Likes Received:
    5
    I think it can done but you have to to arg-1
    Code (Text):
    1. If arg-1 is "example":
    2.     Code
    3.     If arg-2 is set:
    4.         Code
    5.     Else:
    6.         Message "arg 2 is not set"
     
  6. rwdish

    rwdish New Member

    Joined:
    May 8, 2022
    Messages:
    8
    Likes Received:
    0
    Nope. still isn't working.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...