I need help on listing the possible arguments of a 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 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!

kanyelover912

New Member
Dec 26, 2023
5
0
1
23
I'm making a stats sktipt and I need help because I don't know how to list the possible arguments of a command just like minecraft
code_language.skript:
#
#                    KStatistics SKRIPT
#-------------------------------------------------------------------------------------------------
#
#            by: kanyelover
#             
#            please give credits if used on a server!
#




Options:
    mainColour: <##4382e8>
#    ➥ Changes the main colour, you can use <##000000> format or minecraft color codes!
    secondColour: <##75aaff>
#    ➥ Changes the secondary colour, you can use <##000000> format or minecraft color codes!
    permissionOpen: stats.open
#    ➥ Permission needed to open the stats gui
    permissionSet: stats.set
#    ➥ Permission needed to set the stats
    permissionMessage: &4&lYou can't do this!
#    ➥ Permission message
    fillItem: cyan stained glass pane
#   ➥ Sets the fill item
    statPrefix: &8[&cStats&8]
#   ➥ Stat prefix shown on set commands

        
    
on join:
    if {stats::%uuid of player%::firstTime} is not set:
        set {stats::%uuid of player%::firstTime} to "%now%"
    if {stats::%uuid of player%::deaths} is not set:
        set {stats::%uuid of player%::deaths} to 0
    if {stats::%uuid of player%::kills} is not set:
        set {stats::%uuid of player%::kills} to 0
    if {stats::%uuid of player%::blocksBroken} is not set:
        set {stats::%uuid of player%::blocksBroken} to 0

on death:
    add 1 to {stats::%victim's uuid%::deaths}
    if attacker is a player:
        add 1 to {stats::%attacker's uuid%::kills}

on break:
    add 1 to {stats::%uuid of player%::blocksBroken}

on join:
    if {hourCounter::%player's uuid%} is not set:
        set {hourCounter::%player's uuid%} to 0
    if {minuteCounter::%player's uuid%} is not set:
        set {minuteCounter::%player's uuid%} to 0
    set {counter.%player%} to true
    while {counter.%player%} is true:
        wait 1 minute
        add 1 to {minuteCounter::%player's uuid%}
        if {minuteCounter::%player's uuid%} = 60:
            set {minuteCounter::%player's uuid%} to 0
            add 1 to {hourCounter::%player's uuid%}





command /stats [<offline player>] [<text>] [<text>] [<number>] [<number>]:
    aliases: /playerstats, /statistics
    usage: /stats <player> <set> <stat> <number>
    description: open the statistics menu
    permission: {@permissionOpen}
    permission message: {@permissionMessage}
    trigger:
        if arg-1 is not set:
            set metadata tag "statsGui" of player to chest inventory with 5 rows named "{@mainColour}&lSTATS"
            set slots 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9 and 10 and 11 and 12 and 13 and 14 and 15 and 16 and 17 and 18 and 19 and 20 and 21 and 22 and 23 and 24 and 25 and 26 and 27 and 28 and 29 and 30 and 31 and 32 and 33 and 34 and 35 and 36 and 37 and 38 and 39 and 40 and 41 and 42 and 43 and 44 and 45 of metadata tag "statsGui" of player to {@fillItem} named "{@mainColour}&lStats"
            set slot 10 of metadata tag "statsGui" of player to grass block named "{@mainColour}&lBlocks broken" with lore "{@secondColour}You have broken {@mainColour}%{stats::%uuid of player%::blocksBroken}%{@secondColour} block(s)"
            set slot 12 of metadata tag "statsGui" of player to iron sword named "{@mainColour}&lKills" with lore "{@secondColour}You killed {@mainColour}%{stats::%uuid of player%::kills}%{@secondColour} player(s)"
            set slot 14 of metadata tag "statsGui" of player to player's skull named "{@mainColour}&lDeaths" with lore "{@secondColour}You died {@mainColour}%{stats::%uuid of player%::deaths}%{@secondColour} time(s)"
            set slot 16 of metadata tag "statsGui" of player to clock named "{@mainColour}&lPlay time" with lore "{@secondColour}You played {@mainColour}%{hourCounter::%player's uuid%}%{@secondColour} hours and {@mainColour}%{minuteCounter::%player's uuid%}% {@secondColour}minutes"
            set slot 31 of metadata tag "statsGui" of player to sunflower named "{@mainColour}&lFirst join" with lore "{@secondColour}Your first join was on {@mainColour}%{stats::%uuid of player%::firstTime}%"
            open (metadata tag "statsGui" of player) to player
        else if arg-1 is set:
            if arg-2 is not set:
                set {player} to arg-1
                set metadata tag "statsGui" of player to chest inventory with 5 rows named "{@mainColour}&lSTATS"
                set slots 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9 and 10 and 11 and 12 and 13 and 14 and 15 and 16 and 17 and 18 and 19 and 20 and 21 and 22 and 23 and 24 and 25 and 26 and 27 and 28 and 29 and 30 and 31 and 32 and 33 and 34 and 35 and 36 and 37 and 38 and 39 and 40 and 41 and 42 and 43 and 44 and 45 of metadata tag "statsGui" of player to {@fillItem} named "{@mainColour}&lStats"
                set slot 10 of metadata tag "statsGui" of player to grass block named "{@mainColour}&lBlocks broken" with lore "{@secondColour}%{player}% have broken {@mainColour}%{stats::%uuid of arg-1%::blocksBroken}%{@secondColour} block(s)"
                set slot 12 of metadata tag "statsGui" of player to iron sword named "{@mainColour}&lKills" with lore "{@secondColour}%{player}% killed {@mainColour}%{stats::%uuid of arg-1%::kills}%{@secondColour} player(s)"
                set slot 14 of metadata tag "statsGui" of player to player's skull named "{@mainColour}&lDeaths" with lore "{@secondColour}%{player}% died {@mainColour}%{stats::%uuid of arg-1%::deaths}%{@secondColour} time(s)"
                set slot 16 of metadata tag "statsGui" of player to clock named "{@mainColour}&lDeaths" with lore "{@secondColour}%{player}% played {@mainColour}%{hourCounter::%uuid of arg-1%}%{@secondColour} hours and {@mainColour}%{minuteCounter::%uuid of arg-1%}% {@secondColour}minutes"
                set slot 31 of metadata tag "statsGui" of player to sunflower named "{@mainColour}&lFirst join" with lore "{@secondColour}%{player}%'s first join was on {@mainColour}%{stats::%uuid of arg-1%::firstTime}%"
                open (metadata tag "statsGui" of player) to player
            else if arg-2 = "set":
                player has permission "{@permissionSet}":
                    set {statNumber} to arg-4
                    set {player} to arg-1
                    if arg-3 = "blocksmined":
                        set {stats::%uuid of arg-1%::blocksBroken} to arg-4
                        send "{@statPrefix}&f stat &7&l%arg-3%&f of &7&l%arg-1%&f was set to &7&l%{statNumber}%"
                    else if arg-3 = "kills":
                        set {stats::%uuid of arg-1%::kills} to arg-4
                        send "{@statPrefix}&f stat &7&l%arg-3%&f of &7&l%arg-1%&f was set to &7&l%{statNumber}%"
                    
                    else if arg-3 = "deaths":
                        set {stats::%uuid of arg-1%::deaths} to arg-4
                        send "{@statPrefix}&f stat &7&l%arg-3%&f of &7&l%arg-1%&f was set to &7&l%{statNumber}%"

                    else if arg-3 = "playtime":
                        set {hourCounter::%uuid of arg-1%} to arg-4
                        set {minuteCounter::%uuid of arg-1%} to arg-5
                        send "{@statPrefix}&f stat &7&l%arg-3%&f of &7&l%arg-1%&f was set to &7&l%{statNumber}% hours and %arg-5% minutes"
                    
                else:
                    send "{@permissionMessage}" to player
                

                
                


on inventory click:
    if event-inventory = (metadata tag "statsGui" of player):
        cancel event
Code:
command /stats [<offline player>] [<text>] [<text>] [<number>] [<number>]:
    aliases: /playerstats, /statistics
    usage: /stats <player> <set> <stat> <number>
    description: open the statistics menu
    permission: {@permissionOpen}
    permission message: {@permissionMessage}
    trigger:
        if arg-1 is not set:
            set metadata tag "statsGui" of player to chest inventory with 5 rows named "{@mainColour}&lSTATS"
            set slots 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9 and 10 and 11 and 12 and 13 and 14 and 15 and 16 and 17 and 18 and 19 and 20 and 21 and 22 and 23 and 24 and 25 and 26 and 27 and 28 and 29 and 30 and 31 and 32 and 33 and 34 and 35 and 36 and 37 and 38 and 39 and 40 and 41 and 42 and 43 and 44 and 45 of metadata tag "statsGui" of player to {@fillItem} named "{@mainColour}&lStats"
            set slot 10 of metadata tag "statsGui" of player to grass block named "{@mainColour}&lBlocks broken" with lore "{@secondColour}You have broken {@mainColour}%{stats::%uuid of player%::blocksBroken}%{@secondColour} block(s)"
            set slot 12 of metadata tag "statsGui" of player to iron sword named "{@mainColour}&lKills" with lore "{@secondColour}You killed {@mainColour}%{stats::%uuid of player%::kills}%{@secondColour} player(s)"
            set slot 14 of metadata tag "statsGui" of player to player's skull named "{@mainColour}&lDeaths" with lore "{@secondColour}You died {@mainColour}%{stats::%uuid of player%::deaths}%{@secondColour} time(s)"
            set slot 16 of metadata tag "statsGui" of player to clock named "{@mainColour}&lPlay time" with lore "{@secondColour}You played {@mainColour}%{hourCounter::%player's uuid%}%{@secondColour} hours and {@mainColour}%{minuteCounter::%player's uuid%}% {@secondColour}minutes"
            set slot 31 of metadata tag "statsGui" of player to sunflower named "{@mainColour}&lFirst join" with lore "{@secondColour}Your first join was on {@mainColour}%{stats::%uuid of player%::firstTime}%"
            open (metadata tag "statsGui" of player) to player
        else if arg-1 is set:
            if arg-2 is not set:
                set {player} to arg-1
                set metadata tag "statsGui" of player to chest inventory with 5 rows named "{@mainColour}&lSTATS"
                set slots 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9 and 10 and 11 and 12 and 13 and 14 and 15 and 16 and 17 and 18 and 19 and 20 and 21 and 22 and 23 and 24 and 25 and 26 and 27 and 28 and 29 and 30 and 31 and 32 and 33 and 34 and 35 and 36 and 37 and 38 and 39 and 40 and 41 and 42 and 43 and 44 and 45 of metadata tag "statsGui" of player to {@fillItem} named "{@mainColour}&lStats"
                set slot 10 of metadata tag "statsGui" of player to grass block named "{@mainColour}&lBlocks broken" with lore "{@secondColour}%{player}% have broken {@mainColour}%{stats::%uuid of arg-1%::blocksBroken}%{@secondColour} block(s)"
                set slot 12 of metadata tag "statsGui" of player to iron sword named "{@mainColour}&lKills" with lore "{@secondColour}%{player}% killed {@mainColour}%{stats::%uuid of arg-1%::kills}%{@secondColour} player(s)"
                set slot 14 of metadata tag "statsGui" of player to player's skull named "{@mainColour}&lDeaths" with lore "{@secondColour}%{player}% died {@mainColour}%{stats::%uuid of arg-1%::deaths}%{@secondColour} time(s)"
                set slot 16 of metadata tag "statsGui" of player to clock named "{@mainColour}&lDeaths" with lore "{@secondColour}%{player}% played {@mainColour}%{hourCounter::%uuid of arg-1%}%{@secondColour} hours and {@mainColour}%{minuteCounter::%uuid of arg-1%}% {@secondColour}minutes"
                set slot 31 of metadata tag "statsGui" of player to sunflower named "{@mainColour}&lFirst join" with lore "{@secondColour}%{player}%'s first join was on {@mainColour}%{stats::%uuid of arg-1%::firstTime}%"
                open (metadata tag "statsGui" of player) to player
            else if arg-2 = "set":
                player has permission "{@permissionSet}":
                    set {statNumber} to arg-4
                    set {player} to arg-1
                    if arg-3 = "blocksmined":
                        set {stats::%uuid of arg-1%::blocksBroken} to arg-4
                        send "{@statPrefix}&f stat &7&l%arg-3%&f of &7&l%arg-1%&f was set to &7&l%{statNumber}%"
                    else if arg-3 = "kills":
                        set {stats::%uuid of arg-1%::kills} to arg-4
                        send "{@statPrefix}&f stat &7&l%arg-3%&f of &7&l%arg-1%&f was set to &7&l%{statNumber}%"
                    
                    else if arg-3 = "deaths":
                        set {stats::%uuid of arg-1%::deaths} to arg-4
                        send "{@statPrefix}&f stat &7&l%arg-3%&f of &7&l%arg-1%&f was set to &7&l%{statNumber}%"

                    else if arg-3 = "playtime":
                        set {hourCounter::%uuid of arg-1%} to arg-4
                        set {minuteCounter::%uuid of arg-1%} to arg-5
                        send "{@statPrefix}&f stat &7&l%arg-3%&f of &7&l%arg-1%&f was set to &7&l%{statNumber}% hours and %arg-5% minutes"
                    
                else:
                    send "{@permissionMessage}" to player


YOU CAN FIND THIS SKRIPT IN SPIGOT MC!
SPIGOT PAGE
 
SkBee has a tab complete feature if that's what you're asking about.

code_language.skript:
on tab complete of "/breakfast":
    set tab completions for position 1 to "toast", "eggs" and "waffles"
    if tab arg-1 = "toast":
        set tab completions for position 2 to "butter", "peanut_butter" and "jam"
    else if tab arg-1 = "eggs":
        set tab completions for position 2 to "sunny_side_up", "scrambled" and "over_easy"

set {_l::*} to tab args
This was taken from the SkriptHub docs
 
code_language.skript:
on tab complete of "/breakfast":
    set tab completions for position 1 to "toast", "eggs" and "waffles"
    if tab arg-1 = "toast":
        set tab completions for position 2 to "butter", "peanut_butter" and "jam"
    else if tab arg-1 = "eggs":
        set tab completions for position 2 to "sunny_side_up", "scrambled" and "over_easy"

set {_l::*} to tab args
This was taken from the SkriptHub docs
oh okay, tysm!