Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

218
Visualizações
clearInterval() doesn’t work properly. Intervals stack on eachother

Hello everyone I have been having trouble with the setInterval() and clearInterval() functions.

I can’t seem to figure out why it’s not working, been searching for hours trying multiple solutions

I want the user to be able to click on a zone, afterwards it spawns an enemy, you kill the enemy, another respawns

I have it like this but the problem I am having is that when the enemy refreshes, it’s health immediately drops to 0 and its almost like the setIntervals are stacking on top of each other because after it respawns it starts taking double damage.

If anyone could give me insight on this that would be great!

function selectelwynnforestzone(){
var refreshtankattackinterval = setInterval(tankattackenemy, tankattackspeed);

Codepen link https://codepen.io/jonloft/pen/eYMmYQj

(It may look a little wonky but just click the Elwynn forest button)

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda