[Script Asset] Timed Boosts

I’ve created timed boost items that the player can buy in a shop.
Once the player has bought them, a timer starts that depletes even when they are not playing/offline. If timer runs out, the item disappears.
These items should be useful for recurring coin purchases, like buying a ‘week boost pass’.

Timed Boost Items:

  • have a set duration before they break (set in item attribute “passDurationInSec”)
  • give a passive bonus (set in Bonus tab) and gate access to regions.
  • belong to a group, so if you buy one item of a group you can not buy other items of the group until the item has depleted
  • with advanced tier and player saving, they continue to deplete even when the user is not active in the game or even offline, so they should be usable for long durations like a full day or even a week

Item Scripts:




Demo:

  • features 2 groups of Boost (same function, just to show that multiple groups can be created)
  • each has 3 purchasable items with durations 10, 120, 300 seconds
  • 2 sections that are only accessible if user owns the boost item for that region
  • displays the time left for each item in a center bar while item is held

[[[ Timed Boost Demo ]]]
Scripts are open source, so feel free to copy and clone to your heart’s desire!

Features that could be added:

  • displaying the time left as HH:MM:SS
8 Likes