Compare arg with text

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

rwdish

New Member
May 8, 2022
8
0
1
19
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
 
Code:
set {func} to argument 1

if {func} is "assumi"
For in-line conditions remove the "if" part
Code:
{func} is "assumi"
make console execute command "lp user %arg 2% parent set carabiniere"
or
Code:
if {func} is "assumi":
    make console execute command "lp user %arg 2% parent set carabiniere"
 
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
You can just do this
Code:
If arg 1 is "example":
    Code
    If arg 2 is set:
        Code
    Else:
        Message "arg 2 is not set"
 
You can just do this
Code:
If arg 1 is "example":
    Code
    If arg 2 is set:
        Code
    Else:
        Message "arg 2 is not set"
Code:
set {func} to argument 1


For in-line conditions remove the "if" part
Code:
{func} is "assumi"
make console execute command "lp user %arg 2% parent set carabiniere"
or
Code:
if {func} is "assumi":
    make console execute command "lp user %arg 2% parent set carabiniere"
Sadly, none of these work. I'm on 1.16.5 and using skript 2.5.
 
Sadly, none of these work. I'm on 1.16.5 and using skript 2.5.
I think it can done but you have to to arg-1
Code:
If arg-1 is "example":
    Code
    If arg-2 is set:
        Code
    Else:
        Message "arg 2 is not set"
 
Status
Not open for further replies.