Hello there!
I need help for this skript problem.
when I break the one of wheat, I want to save the amount of items to array variables, but I can't do this.
How can I solve this problem?
I need help for this skript problem.
when I break the one of wheat, I want to save the amount of items to array variables, but I can't do this.
How can I solve this problem?
Code:
command /crops:
trigger:
wait 1 ticks
open chest with 3 row named "{@a} %player%" to player
play sound "BLOCK_NOTE_PLING" to player with volume 1 and pitch 10
loop 27 times:
set slot (loop-number)-1 of current inventory of player to {crops.%player%::%loop-number%}
on inventory close:
delete {cropsam.%{_a}%::*}
if inventory name of current inventory of player contains "crops":
set {_a} to inventory name of current inventory of player
replace all "{@a} " with "" in {_a}
delete {crops.%{_a}%::*}
loop 27 times:
add slot (loop-number)-1 of current inventory of player to {crops.%{_a}%::*}
loop {crops.%{_a}%::*}:
add item amount of wheat of {crops.%{_a}%::%loop-index%} to {cropsam.%{_a}%::%loop-index%}
on break of ripe wheat:
wait 1 tick
loop {crops.%player%::*}:
add item amount of loop-value + 1 to item amount of {crops.%player%::%loop-index%}
broadcast "%{crops.%player%::%loop-index%}%"
send player title "" with subtitle "&fYou got &e&lWheat!" for 0.5 seconds
Last edited: