execute if entity @e[nbt={Item:{components:{"minecraft:custom_data":{box:1}}}},type=item] as @e[tag=interaction,type=interaction,limit=1,sort=random,scores={loader.boxcd=..179}] run function ws:work/misc/loader/dropbox
execute as @e[tag=interaction,type=interaction] run function ws:work/misc/loader/truck
execute as @e[type=interaction,tag=interaction] if score @s loader.boxcount matches 1.. run function ws:work/misc/loader/givebox
execute as @e[tag=interaction,type=interaction] run data remove entity @s interaction
execute as @a[team=gruzchik] store result score @s pickup run clear @s minecraft:barrel[minecraft:custom_data~{box:1}] 0
execute as @a[team=gruzchik,x=-1977,y=42,z=-2064,dx=3,dz=-63,dy=10] at @s run function ws:work/misc/loader/getback
execute as @a[team=gruzchik] if score @s pickup matches 0 run function ws:work/misc/loader/attribute_base
execute as @a[team=gruzchik,scores={weight.level=..9}] if score @s pickup matches 1.. run function ws:work/misc/loader/attribute
execute as @a[team=gruzchik] if score @s pickup matches 2.. run function ws:work/misc/loader/clearbarrel
kill @e[nbt={Item:{components:{"minecraft:custom_data":{box:1}}}},type=item]