I have this skript and i want that a player can claim a pressent once a day (reset at midnight) but this one does not work..
options:
present_item: 10 diamond, 20 iron ingot, 15 gold ingot, 5 emerald, 30 coal, cake, 16 cookie, pumpkin pie, mushroom stew, rabbit stew, beetroot stew
on right click on villager:
if display name of event-entity is not "Test":
stop
if display name of event-entity is "Test":
cancel event
set {_current_day} to "%now expanded to ""D""%"
set {_current_year} to "%now expanded to ""yyyy""%"
set {_unique_day_key} to "%{_current_year}%%{_current_day}%"
if {villager_present.%player%.%{_unique_day_key}%} is set:
send "&cYou've already claimed your present for today. Try again tomorrow" to player
stop
else:
set {_random_item} to a random element out of {@present_item}
give 1 of {_random_item} to the player
send "&aYou have received your daily present!" to player
set {villager_present.%player%.%{_unique_day_key} to true
