#Could someone possible help me make it compress everything in 1 go and not one at a time
1 messages · Page 1 of 1 (latest)
why are you looping every second if you're already doing it on pickup?
as for compressing everything
I have thought of the perfect way to make a compressor skript but ive never made it
it would use modulo math
use pickup and and then when inventory if the item is dragged or getting into the player's inventory
but use a while insted of an if, if u want the other thing to work
where {_1} is amount of blocks of the type you wanna compress
where {_2} is amount required for one compressed item
amount of compressed items to give = {_1} % {_2}
then, remove that amount times {_2} of the item from the player's inv
I believe skript has a mod() function to do the % math
while {_p}'s inventory contains 64 of plain cobblestone:
remove 64 of plain Cobblestone from {_p}'s inventory
a loop like that wound't lag the server
yeah I mean there's many ways to do a good compressor skript
but mine's the only one without loops
idk how much ur thing takes up compared to mine
less resources
it's just a bit of math
look at player's inventory, do some math, take and give once
and the other is just an statement. But we are proberly talking about 1-10 ms
you need to look at player inventory every time and then take and give every time
as I said, it doesnt really matter, it's just mc
there's multiple good ways
but if you wanna compare speed, mine is for sure faster cus only math is very often better than loops