Solved extern argument command

  • 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 community!

    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.

SoMuchWessel

Active Member
Apr 3, 2017
147
3
18
Hey guys,
I got 2 pieces of code, but they are both in a different skript file:


code_language.skript:
command /deathnote <text>:
    trigger:
        if arg-1 is not set:
            send "&a/deathnote <Player>"
        else if {%arg-1%.peacekeeper} is true:
            send "&aYou can not deathnote the peacekeeper!" to player
            stop
        else:
            if player is holding a enchanted book named "&cDeathnote" with lore "&7Command: /deathnote <player>":
                loop all players:
                    if arg-1 is player:
                        message "&aYou can not kill yourself!"
                        stop
                    else if "%loop-value%" is arg-1:
                        if arg-1 parsed as a player's gamemode is not creative:
                            kill arg-1 parsed as a player
                            remove 1 enchanted book named "&cDeathnote" with lore "&7Command: /deathnote <player>" from the player
                            broadcast "&c&l%player% killed %arg-1%!"
                        else:
                            message "&cPls don't kill creative ppl :c"


code_language.skript:
on command "/deathnote":
    if {%arg-1%.death} is true:
        cancel event
        send "&c%arg-1% is already dead!" to player

Now, the first code is working fine.
But the second code is saying:
The expression 'argument' can only be used within a command.

Yes, i could add the 2th code to the first code, but that would mean that i need to Tab everything, and it is a skript file of over 1000 lines...

So how can i detect the arg-1 from the /deathnote command in a On Command ?
Because this will help me a lot.
 
Last edited:
because there's no argument in your second command
for example
/command <arg-1> <arg-1>
but "on command "/deathnote":" has no argument in it
 
because there's no argument in your second command
for example
/command <arg-1> <arg-1>
but "on command "/deathnote":" has no argument in it

Is there no way to use the arg-1 from the /deathnote command in the On Command event?
 
Status
Not open for further replies.