Advertisement
natesmithzombies

snail perk help

Dec 28th, 2016
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. function give_snail_perk()
  2. {
  3. self.has_snail_perk = true;
  4. // other shader stuff and stuff to match his tutorial here
  5. self thread check_for_close_zoms();
  6. }
  7.  
  8. function check_for_close_zoms()
  9. {
  10. while(self.has_snail_perk)
  11. {
  12. zoms = GetAISpeciesArray( "axis", "all" );
  13. zoms = util::get_array_of_closest( self.origin, zoms , undefined , undefined, 150 ); // 150 is the max distance. take a look at this function in util.gsc to edit stuff
  14. foreach( zom in zoms )
  15. {
  16. if( !isDefined( zom.is_snailed )
  17. zom thread warp_time();
  18. }
  19. wait(0.05);
  20. }
  21. }
  22.  
  23. function warp_time()
  24. {
  25. self.is_snailed = true;
  26. self ASMSetAnimationRate(0.5);
  27. self SetMoveSpeedScale(.1);
  28. wait(3); // this is how long it will be slowed
  29. self.is_snailed = undefined;
  30. self ASMSetAnimationRate(1);
  31. self SetMoveSpeedScale(1);
  32. }
  33.  
  34. function take_snail_perk()
  35. {
  36. self.has_snail_perk = false;
  37. // other stuff here
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement