How would I check to see if a cooldown has expired within a GUI, and if it has expired, it should be deleted?
Right now, the script I am using displays the correct cooldown, however, once the cooldown is up - it will just continue going up. I honestly don't know how to explain it, but maybe if you read my script you may see what I'm getting at.
{kits.%player%.daily} gets set whenever someone uses /kit daily. It is supposed to last 24 hours, which it does - however within the GUI on the cooldown part of the lore for the healing potion, the cooldown should say 'Claim now!' once the 24 hours is up. It doesn't do this, and instead begins to start a new timer, which will then just continue forever.
TLDR: looking to remove {kits.%player%.daily} after 24 hours have passed.
Right now, the script I am using displays the correct cooldown, however, once the cooldown is up - it will just continue going up. I honestly don't know how to explain it, but maybe if you read my script you may see what I'm getting at.
Code:
open virtual chest with 6 rows named "Kits" to player
if {kits.%player%.daily} is not set:
make gui slot 20 of player with a Healing Potion without any NBT named "&e&lDaily" with lore "&fCooldown: Claim now!" and "&fStatus: &a&lUnlocked!" and " " and "&7Left-click to claim!" and "&7Right-click to preview!" to run player command "/kit daily" using left mouse button
make gui slot 20 of player with a Healing Potion without any NBT named "&e&lDaily" with lore "&fCooldown: Claim now!" and "&fStatus: &a&lUnlocked!" and " " and "&7Left-click to claim!" and "&7Right-click to preview!" to run player command "/kitpreview daily" using right mouse button
else:
set {_waiteddaily} to difference between {kits.%player%.daily} and now
make gui slot 20 of player with a Healing Potion without any NBT named "&e&lDaily" with lore "&fCooldown: %difference between 24 hours and {_waiteddaily}%" and "&fStatus: &a&lUnlocked!" and " " and "&7Left-click to claim!" and "&7Right-click to preview!" to run player command "/kit daily" using left mouse button
make gui slot 20 of player with a Healing Potion without any NBT named "&e&lDaily" with lore "&fCooldown: %difference between 24 hours and {_waiteddaily}%" and "&fStatus: &a&lUnlocked!" and " " and "&7Left-click to claim!" and "&7Right-click to preview!" to run player command "/kitpreview daily" using right mouse button
{kits.%player%.daily} gets set whenever someone uses /kit daily. It is supposed to last 24 hours, which it does - however within the GUI on the cooldown part of the lore for the healing potion, the cooldown should say 'Claim now!' once the 24 hours is up. It doesn't do this, and instead begins to start a new timer, which will then just continue forever.
TLDR: looking to remove {kits.%player%.daily} after 24 hours have passed.