#Auto Compressor

1 messages · Page 1 of 1 (latest)

obsidian flicker
#

on inventory pickup:
if player has wheat seeds named "&eWheat Auto Compressor":
if player has 32 wheat seeds:
remove 32 wheat seeds from player
give player 1 wheat seed named "&eCompressed Seeds"

But the auto compressor isnt working

shrewd kindle
#

Show error message

obsidian flicker
#

there is none

#

the auto compresser doesnt compress

#

it is basically useless

flat swan
#
  1. on break:

You should use on break so when they break the next block, It checks if they have 32 wheat seeds.

  1. if player's inventory contains wheat seeds named "&eWheat Auto Compressor":

Checks if the player's inventory (not offhand) contains the auto compressor.

  1. Check if player has 32 wheat seeds first.

  2. Indentation.

quaint aspenBOT
#

In skript, you need to maintain consistent indentation, meaning you cannot indent 1 line 5 spaces, and the next 7 spaces. Usually it’s recommended you use tabs, however.

A good rule of thumb is to always indent the subsequent line whenever the previous statement ends with a :, an exception to this is in command statements with items before the trigger such as permission: or aliases:

With conditional statements and loops, any code that is indented within the statement will be run as a part of the statement, other code will not be run within the statement. Here is an example of proper indentation:

https://i.imgur.com/PbfZ12M.png

flat swan
#

There you go.

obsidian flicker
#

um

#

soo

flat swan
#

You should now be able to create an "Auto Compressor" skript

obsidian flicker
#

when i did that

#

oh ry

#

ty

obsidian flicker
#

wait i kinda dont understand

#

like send me the pic

#

this is my first ever skript

flat swan
#

You should def not make an auto comp skript as first skript.

here I'll send a little snippet of (not how i'd do it) but how I'd do it if I was a starter.

obsidian flicker
#

oTrixy when i did the skript the first time with block break it worked but kinda now

flat swan
#

Yeah its a bit difficult

#

for starters ^

obsidian flicker
#

only thing wrong was

#

i didnt need 32 seeds

#

i just needed to break it

flat swan
#
    if player's inventory contains wheat seeds:

        set {_amt} to amount of wheat seeds in player's inventory
        set {_required} to 32
        if {_amt} >= {_required}:

            set {_compressAmount} to floor({_amt} / {_required})
            remove ({_compressAmount} * {_required}) of wheat seeds from player's inventory 
            give player {_compressAmount} of wheat seeds named "&eCompressed Seeds"
        
            replace all "block" in {_from} with ""
            send action bar "&fCompressed &a32x &fof &eWheat Seeds &finto &a1x &fof &eCompressed Seeds&f successfully." to player

This works

#

look through it and see what you have to change

#

Its a really bad way to do it

flat swan
obsidian flicker
#

wait is it for 1.20.6 ?

flat swan
#
    if player's inventory contains wheat seeds:            
        set {_amt} to amount of wheat seeds in player's inventory
        set {_required} to 32
        if {_amt} >= {_required}:
            if player's inventory contains wheat seeds named "&aWheat Auto Compressor":

                set {_compressAmount} to floor({_amt} / {_required})
                remove ({_compressAmount} * {_required}) of wheat seeds from player's inventory 
                give player {_compressAmount} of wheat seeds named "&eCompressed Seeds"
            
                replace all "block" in {_from} with ""
                send action bar "&fCompressed &a32x &fof &eWheat Seeds &finto &a1x &fof &eCompressed Seeds&f successfully." to player
flat swan
obsidian flicker
#

aight ty

flat swan
#

My server is 1.21.1

#

I made the snippet way back when it was 1.20.4

#

still works

obsidian flicker
#

aight ty

flat swan
#

Try it and see and np

#

(You should for sure think about updating to 1.21.1(latest)

#

I heard 1.20.6 is a bit buggy

obsidian flicker
#

aight ty

flat swan
#

np