#Reclaimable Playtime rewards

1 messages · Page 1 of 1 (latest)

rocky dawn
#

Just wondering if there is a way to make it so that a player is able to claim a reward every 24 hours of in game playtime. I know that it is possible to set temporary permissions using luck perms so that after a day the player no longer has the claimed tag and is able to claim the reward again, but is there a way to make it so that the temporary permission timer only goes down while the player is actively online?

inner ridge
#

you can get a cooldown list of player

#

good choice of many cooldown

rocky dawn
#

ty

rocky dawn
stoic sleet
stoic sleet
#

Give the players a permission that would expire in X amount of time,

rocky dawn
#

yeah i alr tried that and it does down while offline

stoic sleet
#

Ah okay

blissful ridge
#

ye it counts offline too

#

nvm u mentioned it :/

#

idk if u figured it out but you can to negate the permission with /lp user %player_name% permission settemp <permission> false 24h

#

and in the menu item u ll have it as an item with priority 1 which would check for the has permission and y can make one with priority 2 that says the cooldown

rocky dawn
#

I dont think that would solve the issue though unfortunately. Even with that, the timer goes down while offline, and I am trying to make it so that you would need to be on the server for 24 hours before you can claim the reward, then after you claim it, you would need another 24 hours in game to claim it again. I know how to set that all up, I just need to find a command that only counts down the timer while the player is online, and freezes it when they are offline

stoic sleet
rocky dawn
#

Not really, that wouldnt account for the player not redeeming it instantly. If the player redeems it like an hour after it unlocking then the playtime will have increased, so technically the cooldown would only be 23 hours in that instance

#

I think

stoic sleet
sweet light
#

you could track the player's playtime when the claim the reward and store it

#

then compare the current playtime to the stored playtime

#
%statistic_ticks_played%
%statistic_seconds_played%
%statistic_minutes_played%
%statistic_hours_played%
%statistic_days_played%
%statistic_time_played%
sweet light
#

I have this javascript if needed

rocky dawn
sweet light
#

I would use deluxemenus meta

#

[meta] set REWARD-1-PLAYTIME INTEGER %statistic_minutes_played%

#

minutes played should be accurate enough, no need for seconds, but doesn't really matter

#

if you did hours then they could theoretically skip 59 minutes

#

but would balance out to still be one a day

#

%deluxemenus_meta_REWARD-1-PLAYTIME_INTEGER_0% will return the value you have set, if none is set it will return 0

#
click_requirement:
  requirement:
    24hours:
      type: '>='
      input: '%math_0:_{statistic_minutes_played}-1440%'
      output: '%deluxemenus_meta_REWARD-1-PLAYTIME_INTEGER_0%'
#

something like that should work for the click requirement

#

needs statistic and math expansions

#

If you wanted to show how many minutes till they can claim you could use this

lore:
- 'Time to claim: %math_0:_{deluxemenus_meta_REWARD-1-PLAYTIME_INTEGER_0}+1440-{statistic_minutes_played}% minutes'
rocky dawn