so i have a skript with daily rewards, and i want it to update while in the gui, i just have no idea how. i've tried this, but you have to click on it for it to update.
code_language.skript:
on inventory click:
if inventory name of player's current inventory is "&4&lREWARDS":
if clicked slot is 20:
set {_waited} to difference between {dailyrewardscooldown::%uuid of player%} and now
if {_waited} is less than 1 day:
set {difference} to "%difference between a day and {_waited}%"
set slot 20 of current inventory of player to Redstone Block named "&c&lDaily Reward" with lore "&7&m--------------||&e&lRewards:|| &7&l&oDefault:|| &b● &f100 Coins|| &a&l&oWarrior:|| &b● &f135 Coins|| &6&l&oLegend:|| &b● &f175 Coins|| &5&l&oTitan:|| &b● &f200 Coins|| &d&l&oHero:|| &b● &f275 Coins|| &b&l&oDeity:|| &b● &f500 Coins||&7&m--------------||&cYou can claim this reward||&cagain in %{difference}%&c!||&7&m--------------"
set {dailyrewards::%uuid of player%} to true
stop
else:
delete {dailyrewards::%uuid of player%}
set slot 20 of current inventory of player to Redstone Block named "&c&lDaily Reward" with lore "&7&m--------------||&e&lRewards:|| &7&l&oDefault:|| &b● &f100 Coins|| &a&l&oWarrior:|| &b● &f135 Coins|| &6&l&oLegend:|| &b● &f175 Coins|| &5&l&oTitan:|| &b● &f200 Coins|| &d&l&oHero:|| &b● &f275 Coins|| &b&l&oDeity:|| &b● &f500 Coins||&7&m--------------||&cYou can claim this reward||&cagain in %{difference}%&c!||&7&m--------------"
set {dailyrewardscooldown::%uuid of player%} to now