So, I am making an hourly reward type of thing for my donators, and I have it set to every second in "world", it removes 1 second from the timer variable. The problem is, when the player is offline, it stops removing the 1 second from the variable which is the uuid of the player's timer. I really need it to keep removing 1 second from that variable because then the player can go offline while knowing that in an hour, his reward will be ready. Thanks, and here is my code:
EDIT: Just a note that the timer stops when the player is off of the bungee server, for example, KitPvP, so if I do /hub, it will still stop. The player doesn't have to be off of the whole server for the timer on KitPvP to stop, but just the KitPvP server.
code_language.skript:
on right click on anvil:
cancel event
if player does not have the permission "knight.hourly.reward":
message "&7Error&8> &7This reward is only available to the &8Knight &7rank!"
else:
if {hourly.reward.%uuid of player%} is greater than "0 seconds" parsed as a timespan:
open chest with 3 rows named "&e&lHOURLY REWARD" to player
wait 1 tick
format slot 13 of player with a 322:1 named "&c&lHOURLY REWARD" with lore "&7Reward Delay: 1 hour||&7Time Left: %{hourly.reward.%uuid of player%}%" to close then run [message "&7Error&8> &7You must wait a total of %{hourly.reward.%uuid of player%}% more until you can receive the hourly reward again!"]
else:
open chest with 3 rows named "&e&lHOURLY REWARD" to player
wait 1 tick
format slot 13 of player with a 322:1 named "&e&lHOURLY REWARD" with lore "&7Click to receive your hourly reward!" to close then run [give player 1 322:1 named "&e&lHOURLY REWARD"]->[message "&7Reward&8> &7You have been given your hourly reward!"]->[make console execute command "hourlyrewardactivite %player%"]
command hourlyrewardactivite <player>:
trigger:
set {hourly.reward.%uuid of arg 1%} to "1 hour" parsed as a timespan
every second in "world":
set {1} to "1 second" parsed as a timespan
loop all players:
if {hourly.reward.%uuid of loop-player%} is greater than "0 seconds" parsed as a timespan:
remove {1} from {hourly.reward.%uuid of loop-player%}
EDIT: Just a note that the timer stops when the player is off of the bungee server, for example, KitPvP, so if I do /hub, it will still stop. The player doesn't have to be off of the whole server for the timer on KitPvP to stop, but just the KitPvP server.
Last edited: