1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Remaining time of cooldown

Discussion in 'Development' started by ZenixPlayzMC, Dec 29, 2018.

  1. ZenixPlayzMC

    ZenixPlayzMC Silverfish

    Messages:
    23
    Hi there. I'm making my own kit plugin and I used time() to make a cooldown. But 1 thing. How can I know the remaining minutes and hours of the cooldown. For example, A kit has a cooldown of 2 hours. Then 36 minutes passed. How can I know how much time is left and send it to a player?
     
  2. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    Its simple math
    current time - saved time = time passed
    time left = cooldown - (current time - saved time)
     
    corytortoise and Marabou like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.