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

how to fix PlayerInteractEvent firing multiple times

Discussion in 'Development' started by Levi, Jun 24, 2018.

  1. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    for some reason, when i use playerinteractevent it fires quite a few times. is there fix
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    no, it just fires multiple times
    it's like asking if there's a fix that oxygen exist,
    it just exist, just like how interact event just fires multiple times

    but you can build a cooldown table to prevent it begin counted multiple times
     
  3. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    how would i check if player clicked one times to add cooldown?
     
  4. Kabluinc

    Kabluinc Baby Zombie

    Messages:
    129
    use a variable which you increment every time interact event is fired. Then check if that variable == 1. If it does then add cooldown and reset the variable
     
  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.