Jump to content
  • 0

Auto Compressers Minehut Skript! HELP


GhostV2

Question

I want to make auto compressers (Working) But idk how ive been trying skripting for so long it just always bugged, Auto Compressors for box servers , for example if u get 32 wood in your inventory it gives you a enchanted wood named compressed wood and takes the 32 wood. and it should only work if ur hold the auto comp in your offhand.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

the script for auto compressors is.

options:
    prefix: &2Auto&aCompress
    timeorpickup: 1
    time: 1 second
    autopermission: autocomp.use
    permissionmessage: &fUnknown command. Type "/help" for help.
    getautopermission: staff.getautocomp
    ## timeorpickup: Set to 1 for the check to occur every {@time}, and set to 2 to check on every pickup (may not work with auto pickup)

command /autocompress [<text>]:
    permission: {@autopermission}
    permission message: {@permissionmessage}
    trigger:
        if arg-1 is set:
            if arg-1 is "on":
                set {autopickup::%player's uuid%} to true
                send "{@prefix} &aSet automatic compressions to &etrue&a."
            else:
                if arg-1 is "off":
                    set {autopickup::%player's uuid%} to false
                    send "{@prefix} &aSet automatic compressions to &efalse&a."
                else:
                    if arg-1 is "check":
                        if {autopickup::%player's uuid%} is not true:
                            send "{@prefix} &aYou currently have automatic compressions set to &efalse&a."
                        else:
                            send "{@prefix} &aYou currently have automatic compressions set to &etrue&a."
                    else:
                        if arg-1 is "toggle":
                            if {autopickup::%player's uuid%} is true:
                                set {autopickup::%player's uuid%} to false
                                send "{@prefix} &aSet automatic compressions to &efalse&a."
                            if {autopickup::%player's uuid%} is not true:
                                set {autopickup::%player's uuid%} to true
                                send "{@prefix} &aSet automatic compressions to &etrue&a."
                        else:
                            send "&cInvalid usage. Correct usage: &b/autocompress [on | off | toggle | check]"
        else:
            if {autopickup::%player's uuid%} is true:
                set {autopickup::%player's uuid%} to false
                send "{@prefix} &aSet automatic compressions to &efalse&a."
            if {autopickup::%player's uuid%} is not true:
                set {autopickup::%player's uuid%} to true
                send "{@prefix} &aSet automatic compressions to &etrue&a."

command /getautocompressor [<text>]:
    permission: {@getautopermission}
    permission message: {@permissionmessage}
    trigger:
        if arg-1 is set:
            if arg-1 is "oak" or "wood":
                give player 1 oak wood named "&aAuto Wood Compressor" with lore "&7Automatically compresses oak logs!"
                send "{@prefix} &aYou have received an &eAuto Wood Compressor&a!"
            if arg-1 is "stone":
                give player 1 smooth stone named "&aAuto Stone Compressor" with lore "&7Automatically compresses stone!"
                send "{@prefix} &aYou have received an &eAuto Stone Compressor&a!"
            if arg-1 is "coal":
                give player 1 coal block named "&aAuto Coal Compressor" with lore "&7Automatically compresses coal ore!"
                send "{@prefix} &aYou have received an &eAuto Coal Compressor&a!"
            if arg-1 is "iron":
                give player 1 iron block named "&aAuto Iron Compressor" with lore "&7Automatically compresses iron ore!"
                send "{@prefix} &aYou have received an &eAuto Iron Compressor&a!"
            if arg-1 is "copper":
                give player 1 copper block named "&aAuto Copper Compressor" with lore "&7Automatically compresses copper ore!"
                send "{@prefix} &aYou have received an &eAuto Copper Compressor&a!"
            if arg-1 is "gold":
                give player 1 gold block named "&aAuto Gold Compressor" with lore "&7Automatically compresses gold ore!"
                send "{@prefix} &aYou have received an &eAuto Gold Compressor&a!"
            if arg-1 is "diamond":
                give player 1 diamond block named "&aAuto Diamond Compressor" with lore "&7Automatically compresses diamond ore!"
                send "{@prefix} &aYou have received an &eAuto Diamond Compressor&a!"
            if arg-1 is "emerald":
                give player 1 emerald block named "&aAuto Emerald Compressor" with lore "&7Automatically compresses emearld ore!"
                send "{@prefix} &aYou have received an &eAuto Emerald Compressor&a!"
            if arg-1 is "super" or "auto":
                give player 1 netherite block named "&aAuto Compressor" with lore "&7Automatically compresses everything compressable!"
                send "{@prefix} &aYou have received an &eAuto Compressor&a! &8(Automatically compresses everything compressable)"
            if arg-1 is "all" or "everything":
                give player 1 oak wood named "&aAuto Wood Compressor" with lore "&7Automatically compresses oak logs!"
                give player 1 smooth stone named "&aAuto Stone Compressor" with lore "&7Automatically compresses stone!"
                give player 1 coal block named "&aAuto Coal Compressor" with lore "&7Automatically compresses coal ore!"
                give player 1 iron block named "&aAuto Iron Compressor" with lore "&7Automatically compresses iron ore!"
                give player 1 copper block named "&aAuto Copper Compressor" with lore "&7Automatically compresses copper ore!"
                give player 1 gold block named "&aAuto Gold Compressor" with lore "&7Automatically compresses gold ore!"
                give player 1 diamond block named "&aAuto Diamond Compressor" with lore "&7Automatically compresses diamond ore!"
                give player 1 emerald block named "&aAuto Emerald Compressor" with lore "&7Automatically compresses emearld ore!"
                give player 1 netherite block named "&aAuto Compressor" with lore "&7Automatically compresses everything compressable!"
                send "{@prefix} &aYou have received &eevery auto compressor&a!"
            if arg-1 is not "oak" or "wood" or "stone" or "coal" or "iron" or "copper" or "gold" or "diamond" or "emerald" or "super" or "auto" or "all" or "everything":
                send "&cInvalid compressor name. Valid compressors: &b/getautocompressor [oak/wood | stone | coal | iron | copper | gold | diamond | emerald | super/auto | all/everything]"
        else:
            send "&cInvalid usage. Correct usage: &b/getautocompressor [oak/wood | stone | coal | iron | copper | gold | diamond | emerald | super/auto | all/everything]"

every {@time}:
    if {@timeorpickup} is 1:
        autoCompress()

on pickup:
    if {@timeorpickup} is 2:
        autoCompress()

function autoCompress():
    loop all players:
        if loop-player's offhand is oak wood named "&aAuto Wood Compressor" with lore "&7Automatically compresses oak logs!":
            if loop-player has 64 oak logs:
                set {_amount} to number of oak logs in loop-player's inventory
                set {_amount} to {_amount} / 64
                set {_amount} to floor({_amount})
                loop {_amount} times:
                    remove ({_amount} * 64) of oak logs from loop-player's inventory
                    give {_amount} of oak wood named "&aCompressed Oak Log" to loop-player
        
        
        if loop-player's offhand is smooth stone named "&aAuto Stone Compressor" with lore "&7Automatically compresses stone!":
            if loop-player has 64 stone:
                set {_amount} to number of stone in loop-player's inventory
                set {_amount} to {_amount} / 64
                set {_amount} to floor({_amount})
                loop {_amount} times:
                    remove ({_amount} * 64) of stone from loop-player's inventory    
                    give {_amount} of smooth stone named "&aCompressed Stone" to loop-player
        
        
        if loop-player's offhand is coal block named "&aAuto Coal Compressor" with lore "&7Automatically compresses coal ore!":
            if loop-player has 64 coal ore:
                set {_amount} to number of coal ore in loop-player's inventory
                set {_amount} to {_amount} / 64
                set {_amount} to floor({_amount})
                loop {_amount} times:
                    remove ({_amount} * 64) of coal ore from loop-player's inventory    
                    give {_amount} of coal block named "&aCompressed Coal" to loop-player
        
        
        if loop-player's offhand is iron block named "&aAuto Iron Compressor" with lore "&7Automatically compresses iron ore!":
            if loop-player has 64 iron ore:
                set {_amount} to number of iron ore in loop-player's inventory
                set {_amount} to {_amount} / 64
                set {_amount} to floor({_amount})
                loop {_amount} times:
                    remove ({_amount} * 64) of iron ore from loop-player's inventory    
                    give {_amount} of iron block named "&aCompressed Iron" to loop-player
        
        
        if loop-player's offhand is copper block named "&aAuto Copper Compressor" with lore "&7Automatically compresses copper ore!":
            if loop-player has 64 copper ore:
                set {_amount} to number of copper ore in loop-player's inventory
                set {_amount} to {_amount} / 64
                set {_amount} to floor({_amount})
                loop {_amount} times:
                    remove ({_amount} * 64) of copper ore from loop-player's inventory    
                    give {_amount} of copper block named "&aCompressed Copper" to loop-player
        
        
        if loop-player's offhand is gold block named "&aAuto Gold Compressor" with lore "&7Automatically compresses gold ore!":
            if loop-player has 64 gold ore:
                set {_amount} to number of gold ore in loop-player's inventory
                set {_amount} to {_amount} / 64
                set {_amount} to floor({_amount})
                loop {_amount} times:
                    remove ({_amount} * 64) of gold ore from loop-player's inventory    
                    give {_amount} of gold block named "&aCompressed Gold" to loop-player
        
        
        if loop-player's offhand is diamond block named "&aAuto Diamond Compressor" with lore "&7Automatically compresses diamond ore!":
            if loop-player has 64 diamond ore:
                set {_amount} to number of diamond ore in loop-player's inventory
                set {_amount} to {_amount} / 64
                set {_amount} to floor({_amount})
                loop {_amount} times:
                    remove ({_amount} * 64) of diamond ore from loop-player's inventory    
                    give {_amount} of diamond block named "&aCompressed Diamond" to loop-player
        
        
        if loop-player's offhand is emerald block named "&aAuto Emerald Compressor" with lore "&7Automatically compresses emerald ore!":
            if loop-player has 64 emerald ore:
                set {_amount} to number of emerald ore in loop-player's inventory
                set {_amount} to {_amount} / 64
                set {_amount} to floor({_amount})
                loop {_amount} times:
                    remove ({_amount} * 64) of emerald ore from loop-player's inventory    
                    give {_amount} of emerald block named "&aCompressed Emerald" to loop-player


        if loop-player's offhand is netherite block named "&aAuto Compressor" with lore "&7Automatically compresses everything compressable!":
            set {_compressable::*} to oak log, stone, coal ore, iron ore, copper ore, gold ore, diamond ore, and emerald ore
            loop {_compressable::*}:
                if loop-player has 64 of loop-value-2:
                    set {_amount} to number of loop-value-2 in loop-player's inventory
                    set {_amount} to {_amount} / 64
                    set {_amount} to floor({_amount})
                    loop {_amount} times:
                        remove ({_amount} * 64) of loop-value-2 from loop-player's inventory
                        if loop-value-2 is oak log:
                            give {_amount} of oak wood named "&aCompressed Oak Log" to loop-player
                        if loop-value-2 is stone:
                            give {_amount} of smooth stone named "&aCompressed Stone" to loop-player
                        if loop-value-2 is coal ore:
                            give {_amount} of coal block named "&aCompressed Coal" to loop-player
                        if loop-value-2 is iron ore:
                            give {_amount} of iron block named "&aCompressed Iron" to loop-player
                        if loop-value-2 is copper ore:
                            give {_amount} of copper block named "&aCompressed Copper" to loop-player
                        if loop-value-2 is gold ore:
                            give {_amount} of gold block named "&aCompressed Gold" to loop-player
                        if loop-value-2 is diamond ore:
                            give {_amount} of diamond block named "&aCompressed Diamond" to loop-player
                        if loop-value-2 is emerald ore:
                            give {_amount} of emerald block named "&aCompressed Emerald" to loop-player

you can copy and paste it, well i think that's the script

Edited by fireberry
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...