#function autocompressor
1 messages · Page 1 of 1 (latest)
Deleted it in the other channel I posted it in beforehand as it's easier to know whether people have responded if it's just in a forum sorry
this is what I have now, no syntax errors but it doesn't work 😢
on load:
set {oakLog} to oak log
set (name of {oakLog}) to "&fOak Log"
set {compOakLog} to of oak log with all item flags
set (name of {compOakLog}) to "&fCompressed Oak Log"
enchant {compOakLog} with mending
set {oakCompressor} to of dispenser
set (name of {oakCompressor}) to "&fOak Compressor"
function compress(compressing:item, compressor:item, amountNeeded:number, compressingTo:item, p:player):
wait 1 tick
if {_p} is holding {_compressor} in off-hand:
if {_p} has {_compressing} in inventory:
set {_a} to amount of {_compressing} in inventory of {_p}
set {_b} to {_a} / {_amountNeeded}
set {_b} to floor({_b})
set {_c} to {_b} * {_amountNeeded}
remove {_c} of {_compressing} from {_p}
give {_b} of {_compressingTo} to {_p}
on break of oak log:
cancel drops
give player 8 of {oakLog}
compress({oakLog}, {oakCompressor}, 32, {compOakLog}, player)
wait
what