Eating Cooldown

Discussion in 'Development' started by A354-PH, Feb 10, 2019.

  1. A354-PH

    A354-PH Baby Zombie

    Messages:
    122
    GitHub:
    A354-PH
    how to add a cooldown on eating food?
    like when u ate 2 gapples, u cant eat another one before a 15 second cooldown
     
  2. KielKing

    KielKing Baby Zombie

    Messages:
    112
    GitHub:
    kielking
    create a json DB, keep incrementing the player's index everytime he eats an apple, then check if value >= 2, if yes, unset the player's value and put the player in the array with the value of time(), PlayerConsumeItemEvent, check if item is apple, check if player is in array, check if array time + 15 >= time(); if yes, unset the player In the array
     
  3. A354-PH

    A354-PH Baby Zombie

    Messages:
    122
    GitHub:
    A354-PH
    I'm done xd
     
  4. Zach1603

    Zach1603 Silverfish

    Messages:
    18
    A354-PH likes this.

Share This Page

  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.