Command not registering

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

AmazinDooD

Member
Jan 31, 2024
2
0
1
I made this simple-ish skript to add a rarity (lore) to an item based on an argument but when I reload the skript it gives me "A tab completer cannot be assigned before the command is defined".
Also the command "/setrarity" won't register and cannot be used.

Code:
command /setrarity <text>:
    trigger:
        if arg-1 is equal to "basic":
            add "%nl%&7&lBASIC" to lore of player's held item
        else if arg-1 is equal to "common":
            add "%nl%&f&lCOMMON" to lore of player's held item
        else if arg-1 is equal to "uncommon":
            add "%nl%&a&lUNCOMMON" to lore of player's held item
        else if arg-1 is equal to "rare":
            add "%nl%&9&lRARE" to lore of player's held item
        else if arg-1 is equal to "legendary":
            add "%nl%&6&lLEGENDARY" to lore of player's held item
        else if arg-1 is equal to "divine":
            add "%nl%&d&ki &d&lDIVINE &d&ki" to lore of player's held item
        else if arg-1 is equal to "admin":
            add "%nl%&c&l&k_ &c&lADMIN &c&l&k_" to lore of player's held item
        else if arg-1 is equal to "limited":
            add "%nl%&3&ki &3&lLIMITED &3&ki" to lore of player's held item

on tab completer for "/setrarity":
    argument at 2 is not set:
        add "basic" to completions
        add "common" to completions
        add "uncommon" to completions
        add "rare" to completions
        add "legendary" to completions
        add "divine" to completions
        add "admin" to completions
        add "limited" to completions
 
I made this simple-ish skript to add a rarity (lore) to an item based on an argument but when I reload the skript it gives me "A tab completer cannot be assigned before the command is defined".
Also the command "/setrarity" won't register and cannot be used.

Code:
command /setrarity <text>:
    trigger:
        if arg-1 is equal to "basic":
            add "%nl%&7&lBASIC" to lore of player's held item
        else if arg-1 is equal to "common":
            add "%nl%&f&lCOMMON" to lore of player's held item
        else if arg-1 is equal to "uncommon":
            add "%nl%&a&lUNCOMMON" to lore of player's held item
        else if arg-1 is equal to "rare":
            add "%nl%&9&lRARE" to lore of player's held item
        else if arg-1 is equal to "legendary":
            add "%nl%&6&lLEGENDARY" to lore of player's held item
        else if arg-1 is equal to "divine":
            add "%nl%&d&ki &d&lDIVINE &d&ki" to lore of player's held item
        else if arg-1 is equal to "admin":
            add "%nl%&c&l&k_ &c&lADMIN &c&l&k_" to lore of player's held item
        else if arg-1 is equal to "limited":
            add "%nl%&3&ki &3&lLIMITED &3&ki" to lore of player's held item

on tab completer for "/setrarity":
    argument at 2 is not set:
        add "basic" to completions
        add "common" to completions
        add "uncommon" to completions
        add "rare" to completions
        add "legendary" to completions
        add "divine" to completions
        add "admin" to completions
        add "limited" to completions
Tab completers MUST go in a separate file other than the targeted command. I used a separate file for multiple different commands I wanted to have a command completion. If you plan on doing the same, I suggest you do the same and have tab completer files entirely separate from their target commands for better organization and so it actually works.
 
Tab completers MUST go in a separate file other than the targeted command. I used a separate file for multiple different commands I wanted to have a command completion. If you plan on doing the same, I suggest you do the same and have tab completer files entirely separate from their target commands for better organization and so it actually works.
I found the error, I was using the wrong command :emoji_skull: