It doesn't give any errors but the command i made doesn't work. | skript

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

zDrxp

Member
Jan 28, 2024
3
0
1
ok so i made a command that opens a gui where u can compress ur stuff but when i reload it, it doesnt give any errors but
the command just doesnt work (it gives the vannila error)

Code:
command /comp:
    permission: direboxz.compress
    permission message: &2You don't have permission to do this!
    cooldown: 10 seconds
    cooldown message: &2You need to wait 10 seconds to use this command!
    cooldown bypass: direboxz.compress.bypass
    trigger:
        open virtual chest inventory with size 1 named "&2&lCompressor" to player
        format gui slot 1 of player with red stained glass pane named "&2Select which dimension that the blocks you want to compress are in!"
        format gui slot 2 of player with red stained glass pane named "&2Select which dimension that the blocks you want to compress are in!"
        format gui slot 4 of player with red stained glass pane named "&2Select which dimension that the blocks you want to compress are in!"
        format gui slot 6 of player with red stained glass pane named "&2Select which dimension that the blocks you want to compress are in!"
        format gui slot 8 of player with red stained glass pane named "&2Select which dimension that the blocks you want to compress are in!"
        format gui slot 9 of player with red stained glass pane named "&2Select which dimension that the blocks you want to compress are in!"
        format gui slot 5 of player with netherrack named "&2&lNether" to run:
            close player's inventory
            open virtual chest inventory with size 3 named "&2&lCompressor" to player
            format gui slot 1 of player with netherrack named "&2&lNetherrack" with lore &7Click to compress your netherrack!" to run:
                if player doesn't have the permission "direboxz.compress.all":
                    set {amount::%player%} to amount of netherrack in player's inventory
                    if {amount::%player%} is bigger than 64:
                        set {index::%player%} to {amount::%player%} - 64
                        set {gain::%player%} to {amount::%player%} - {index::%player%}
                        set {to-remove::%player%} to {gain::%player%} * 64
                        give player {gain::%player%} "&2&lCompressed Netherrack"
                        remove {to-remove::%player%} netherrack from player
 
I've worked with compressors before. Trust me, it's not a fun task. You can probably start by using a variable for the chest inventory instead of opening the inventory and then formatting it.
 
  • Like
Reactions: zDrxp
ty for the variable idea but i just made it a command instead of a gui so it worked
anyone whos here can use this but im lazy enough to change the server name
skript version: 2.8.2
skbee version: 2.11.0
server version: paper-550 for mc 1.19.4

Code:
command /comp <text>:
    aliases: /compress
    executable by: players
    permission: direboxz.compress
    permission message: "&4You don't have the permission to use this command!"
    cooldown: 15 seconds
    cooldown message: &4You need to wait 15 seconds before using this command again!
    cooldown bypass: direboxz.compress.cooldown.bypass
    description: &6&lDire&b&lBoxz &cCorrect Usage: "/comp all" or "/comp <The dimension of the blocks you want to compress>"
    trigger:
        if arg-1 is not "wood" or "stone" or "coal" or "iron" or "gold" or "diamond" or "emerald" or "tuff" or "slime" or "lime":
            send "&6&lDire&b&lBoxz &rCorrect Usage:&r /comp <item-name> (Do /comp list to view the list of available items!)" to player
        # WOOD
        if arg-1 is "wood":
            set {_lock} to 0
            if player's inventory contains stripped birch wood or 64 of stripped oak wood:
                set {_amount} to amount of stripped birch wood in inventory of player
                remove {_amount} of stripped birch wood from player's inventory
                give player {_amount} * 3 of stripped oak wood
                set {_lock} to 1
            if player's inventory contains 64 of stripped oak wood:
                wait 2 ticks
                loop 35 times:
                    if player's inventory contains 64 of stripped oak wood:
                        remove 64 stripped oak wood from player's inventory
                        give player 1 oak wood named "&6&lCompressed Wood"
                        send action bar "&6&lDire&b&lBoxz &fSuccessfully compressed your wood!" to player
                    else:
                        stop loop
            else:
                if {_lock} is 0:
                    send action bar "&6&lDire&b&lBoxz &r&cYou need at least a stack of stripped oak log to compress!" to player

        # STONE
        if arg-1 is "stone":
            set {_lock} to 0
            if player's inventory contains smooth stone:
                set {_amount} to amount of smooth stone in inventory of player
                remove {_amount} of smooth stone from player's inventory
                give player {_amount} * 3 of stone
                set {_lock} to 1
            if player's inventory contains 64 of cobblestone or smooth stone:
                wait 2 ticks
                loop 35 times:
                    if player's inventory contains 64 of cobblestone:
                        remove 64 cobblestone from player's inventory
                        give player 1 stone bricks named "&7&lCompressed Stone"
                        send action bar "&6&lDire&b&lBoxz &fSuccessfully compressed your stone!" to player
                    else:
                        stop loop
            else:
                if {_lock} is 0:
                    send action bar "&6&lDire&b&lBoxz &r&cYou need at least a stack of cobblestone to compress!" to player


        # COAL
        if arg-1 is "coal":
            set {_lock} to 0
            if player's inventory contains block of coal:
                set {_amount} to amount of block of coal in inventory of player
                remove {_amount} of block of coal from player's inventory
                give player {_amount} * 9 of coal
                set {_lock} to 1
            if player's inventory contains 64 of coal or block of coal:
                wait 2 ticks
                loop 35 times:
                    if player's inventory contains 64 of coal:
                        remove 64 coal from player's inventory
                        give player 1 black wool named "&0&lCompressed Coal"
                        send action bar "&6&lDire&b&lBoxz &fSuccessfully compressed your coal!" to player
                    else:
                        stop loop
            else:
                if {_lock} is 0:
                    send action bar "&6&lDire&b&lBoxz &r&cYou need at least a stack of coal to compress!" to player

        # IRON
        if arg-1 is "iron":
            set {_lock} to 0
            if player's inventory contains block of iron:
                set {_amount} to amount of block of iron in inventory of player
                remove {_amount} of block of iron from player's inventory
                give player {_amount} * 9 of raw iron
                set {_lock} to 1
            if player's inventory contains 64 of raw iron:
                wait 2 ticks
                loop 38 times:
                    if player's inventory contains 64 of raw iron:
                        remove 64 raw iron from player's inventory
                        give player 1 raw iron block named "&f&lCompressed Iron"
                        send action bar "&6&lDire&b&lBoxz &fSuccessfully compressed your iron!" to player
                    else:
                        stop loop
            else:
                if {_lock} is 0:
                    send action bar "&6&lDire&b&lBoxz &r&cYou need at least a stack of raw iron to compress!" to player

        # GOLD
        if arg-1 is "gold":
            set {_lock} to 0
            if player's inventory contains block of gold:
                set {_amount} to amount of block of gold in inventory of player
                remove {_amount} of block of gold from player's inventory
                give player {_amount} * 9 of raw gold
                set {_lock} to 1
            if player's inventory contains 64 of raw gold:
                wait 2 ticks
                loop 38 times:
                    if player's inventory contains 64 of raw gold:
                        remove 64 raw gold from player's inventory
                        give player 1 raw gold block named "&6&lCompressed Gold"
                        send action bar "&6&lDire&b&lBoxz &fSuccessfully compressed your gold!" to player
                    else:
                        stop loop
            else:
                if {_lock} is 0:
                    send action bar "&6&lDire&b&lBoxz &r&cYou need at least a stack of raw gold to compress!" to player

        # LIME
        if arg-1 is "lime":
            if player's inventory contains 64 of lime wool:
                wait 2 ticks
                loop 38 times:
                    if player's inventory contains 64 of lime wool:
                        remove 64 of lime wool from player's inventory
                        give player 1 lime concrete powder named "&a&lCompressed Lime"
                        send action bar "&6&lDire&b&lBoxz &fSuccessfully compressed your lime!" to player
                    else:
                        stop loop
            else:
                send action bar "&6&lDire&b&lBoxz &r&cYou need at least a stack of lime wool to compress!" to player
                
        # DIAMOND
        if arg-1 is "diamond":
            set {_lock} to 0
            if player's inventory contains block of diamond:
                set {_amount} to amount of block of diamond in inventory of player
                remove {_amount} of block of diamond from player's inventory
                give player {_amount} * 9 of diamond
                set {_lock} to 1
            if player's inventory contains 64 of diamond:
                wait 2 ticks
                loop 38 times:
                    if player's inventory contains 64 of diamond:
                        remove 64 diamond from player's inventory
                        give player 1 blue ice named "&3&lCompressed Diamond"
                        send action bar "&6&lDire&b&lBoxz &fSuccessfully compressed your diamonds!" to player
                    else:
                        stop loop
            else:
                if {_lock} is 0:
                    send action bar "&6&lDire&b&lBoxz &r&cYou need at least a stack of diamonds to compress!" to player

        # EMERALD
        if arg-1 is "emerald":
            set {_lock} to 0
            if player's inventory contains block of emerald:
                set {_amount} to amount of block of emerald in inventory of player
                remove {_amount} of block of emerald from player's inventory
                give player {_amount} * 9 of emerald
                set {_lock} to 1
            if player's inventory contains 64 of emerald:
                wait 2 ticks
                loop 38 times:
                    if player's inventory contains 64 of emerald:
                        remove 64 emerald from player's inventory
                        give player 1 green wool named "&2&lCompressed Emerald"
                        send action bar "&6&lDire&b&lBoxz &fSuccessfully compressed your emerald!" to player
                    else:
                        stop loop
            else:
                if {_lock} is 0:
                    send action bar "&6&lDire&b&lBoxz &r&cYou need at least a stack of emeralds to compress!" to player

        # TUFF
        if arg-1 is "tuff":
            set {_lock} to 0
            if player's inventory contains light gray concrete:
                set {_amount} to amount of light gray concrete in inventory of player
                remove {_amount} of light gray concrete from player's inventory
                give player {_amount} * 3 of cyan terracotta
                set {_lock} to 1
            if player's inventory contains 64 of cyan terracotta or light gray concrete:
                wait 2 ticks
                loop 35 times:
                    if player's inventory contains 64 of cyan terracotta:
                        remove 64 cyan terracotta from player's inventory
                        give player 1 gray concrete powder named "&8&lCompressed Tuff"
                        send action bar "&6&lDire&b&lBoxz &fSuccessfully compressed your tuff!" to player
                    else:
                        stop loop
            else:
                if {_lock} is 0:
                    send action bar "&6&lDire&b&lBoxz &r&cYou need at least a stack of cyan terracota to compress!" to player

        # SLIME
        if arg-1 is "slime":
            if player's inventory contains 64 of slime block:
                wait 2 ticks
                loop 38 times:
                    if player's inventory contains 64 of slime block:
                        remove 64 of slime block from player's inventory
                        give player 1 lime dye named "&a&lCompressed Sime"
                        send action bar "&6&lDire&b&lBoxz &fSuccessfully compressed your slime!" to player
                    else:
                        stop loop
            else:
                send action bar "&6&lDire&b&lBoxz &r&cYou need at least a stack of slime to compress!" to player

# TAB COMPLETING
on tab complete of "/comp":
    set tab completions for position 1 to "Wood" and "Stone" and "Coal" and "Iron" and "Gold" and "Diamond" and "Emerald" and "Tuff" and "Slime" and "Lime"
 

Attachments

  • 2024-02-16_17.51.35_edited.png
    2024-02-16_17.51.35_edited.png
    36.2 KB · Views: 144