Jump to content
  • 0

NPC action with loop


Kawita

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.02
  • Content Count:  13
  • Reputation:   0
  • Joined:  06/11/23
  • Last Seen:  

I'm trying to create a loop for an NPC that counts down from 10 to 0 every second, and when it reaches 0 the loop stops and performs an action like hiding the npc, the problem I'm having is that it doesn't stop at 0 and when clicking on the npc the numbers get out of control, I just want the npc to count from 10 backwards to 0 and that when it reaches 0 the npc hides and on the other hand clicking on the npc does not affect or alter his account In the loop

 

guild_vs1-1,50,49,3    script    Valkyrie    811 ,{

     query_sql "UPDATE `valkyrie` SET `puntos` = 10";
OnInit:
    query_sql "SELECT `puntos` FROM `valkyrie`",.@puntos$;


    do {
    
    waitingroom "HP: "+.@puntos$+"",0;    

    query_sql "UPDATE `valkyrie` SET `puntos` = `puntos` - 1";

    sleep 1000;

    } while(1); 
    
    disablenpc "Valkyrie";
end;
}

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...