Hey, I'm currently doing a daily lootchest for my server. Every player can get new stuff there every day.
The problem with my current script is that when you click on the box, new loot comes up and any player can take it. Can anyone help me that each player has separate DailyChests?
The problem with my current script is that when you click on the box, new loot comes up and any player can take it. Can anyone help me that each player has separate DailyChests?
Code:
on load:
clear {dailychest::*}
add 9 honey bottle to {dailychest::*}
add 13 coal to {dailychest::*}
add 6 apple to {dailychest::*}
add 11 pumpkin pie to {dailychest::*}
add 13 oak log to {dailychest::*}
add 2 obsidian to {dailychest::*}
add 10 gold ingot to {dailychest::*}
add 17 bricks to {dailychest::*}
add 10 arrow to {dailychest::*}
add 1 ender pearl to {dailychest::*}
add 3 golden apple to {dailychest::*}
add 1 iron sword to {dailychest::*}
add 6 xp bottle to {dailychest::*}
add 1 iron axe to {dailychest::*}
add 4 slimeball to {dailychest::*}
every 40 seconds:
if "%now%" contains "00:00":
loop all players:
set {lootchest.%uuid of loop-player%} to false
loop all offline players:
set {lootchest.%uuid of loop-offline player%} to false
on rightclick:
if location of event-block is {lootchest}:
if {lootchest.%uuid of player%} is false:
loop all blocks in radius 3 of player:
if loop-block is a chest:
clear loop-block's inventory
set {lootchest.%uuid of player%} to true
set {_items} to a random number between 4 and 8
loop {_items} times:
set {_randomitems} to random element out of {dailychest::*}
set {_slots} to random integer between 0 and 27
set slot {_slots} of loop-block's inventory to {_randomitems}
else:
stop
else:
stop