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

RoosSkywalker

Member
Jul 16, 2022
14
0
1
I use FactionsUUID and Lands, I want both to work together so I have been building a script to make it happen. However, when it comes to banning and kicking from factions I need to be able to target the second argument in the command and I do not know how to do that. All commands in this script are existing commands.

Skript version 2.6.3 vanilla only.

Code:
on command "/f ban":
    make player execute command "/lands ban %arg-2%"

on command "/f kick":
    make player execute command "/lands untrust %arg-2%"

Produces the errors:
Code:
[23:55:14 INFO]: [Skript] Reloading factionleave.sk...
[23:55:14 INFO]: Line 8: (factionleave.sk)
[23:55:14 INFO]:     The expression 'argument' can only be used within a command
[23:55:14 INFO]:     Line: make player execute command "/lands ban %arg-2%"
[23:55:14 INFO]:
[23:55:14 INFO]: Line 11: (factionleave.sk)
[23:55:14 INFO]:     The expression 'argument' can only be used within a command
[23:55:14 INFO]:     Line: make player execute command "/lands untrust %arg-2%"
[23:55:14 INFO]:
[23:55:14 INFO]: [Skript] Encountered 2 errors while reloading factionleave.sk! (41ms)
[doublepost=1662919855,1662846979][/doublepost]This code returns kick RoosSkywalker as the second argument instead of the player name RoosSkywalker.
Why?
Code:
on command "/f kick":
    set {arg-2} to arguments
    # make player execute command "/lands untrust %arg-2%"
    send "%{arg-2}%" to player

EDIT:
This code returns kick RoosSkywalker as value for argument 2 instead of the player name RoosSkywalker. Why? Changing the variable to argument 3 has the same value.
 
Last edited:
Status
Not open for further replies.