Advertisement
S0lll0s

CS:GO Popflash Training Script

Oct 3rd, 2014
1,557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | None | 0 0
  1. // UPDATED VERSION: https://github.com/S0lll0s/csgo-vscripts/blob/master/nadetraining.nut / http://pastebin.com/6mV7LbiU
  2.  
  3. this.pos <- null;
  4. this.vel <- null;
  5.  
  6. function savePos() {
  7.     local nade = null;
  8.    
  9.     while ( Entities.FindByClassname(nade, "flashbang_projectile") != null ) {
  10.         nade = Entities.FindByClassname(nade, "flashbang_projectile");
  11.         ScriptPrintMessageCenterAll( "found flash" );
  12.         pos = nade.GetCenter();
  13.         vel = nade.GetVelocity();
  14.     }
  15.    
  16.     nade = null;
  17.     while ( Entities.FindByClassname(nade, "hegrenade_projectile") != null ) {
  18.         nade = Entities.FindByClassname(nade, "hegrenade_projectile");
  19.         ScriptPrintMessageCenterAll( "found nade" );
  20.         pos = nade.GetCenter();
  21.         vel = nade.GetVelocity();
  22.     }
  23. }
  24.  
  25. function restorePos() {
  26.     local nade = null;
  27.     while ( Entities.FindByClassname(nade, "flashbang_projectile") != null ) {
  28.         nade = Entities.FindByClassname(nade, "flashbang_projectile");
  29.         if ( pos != null ) {
  30.             nade.SetAbsOrigin(pos);
  31.             nade.SetVelocity( vel );
  32.         }
  33.     }
  34.     nade = null;
  35.     while ( Entities.FindByClassname(nade, "hegrenade_projectile") != null ) {
  36.         nade = Entities.FindByClassname(nade, "hegrenade_projectile");
  37.         if ( pos != null ) {
  38.             nade.SetAbsOrigin(pos);
  39.             nade.SetVelocity( vel );
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement