Advertisement
Guest User

script 2

a guest
Mar 28th, 2020
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. drawZombiesCounter()
  2. {
  3. level.zombiesCountDisplay = createServerFontString("Objective" , 1.7);
  4. level.zombiesCountDisplay setPoint("RIGHT", "CENTER", 315, "CENTER");
  5.  
  6. thread updateZombiesCounter();
  7. }
  8.  
  9. updateZombiesCounter()
  10. {
  11. level endon("stopUpdatingZombiesCounter");
  12.  
  13. while(true)
  14. {
  15. zombiesCount = get_current_zombie_count();
  16. level.zombiesCountDisplay setSafeText("Zombies: " + zombiesCount);
  17.  
  18. waitForZombieCountChanged("stopUpdatingZombiesCounter");
  19. }
  20. }
  21.  
  22. recreateZombiesCounter()
  23. {
  24. level notify("stopUpdatingZombiesCounter");
  25.  
  26. thread updateZombiesCounter();
  27. }
  28.  
  29. waitForZombieCountChanged(endonNotification)
  30. {
  31. level endon(endonNotification);
  32.  
  33. oldZombiesCount = get_current_zombie_count();
  34.  
  35. while(true)
  36. {
  37. newZombiesCount = get_current_zombie_count();
  38.  
  39. if(oldZombiesCount != newZombiesCount)
  40. {
  41. return;
  42. }
  43.  
  44. wait 0.05;
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement