Advertisement
S0lll0s

CS:GO Popflash Training 1.1

Oct 6th, 2014
691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.27 KB | None | 0 0
  1. /* nadetraining.nut
  2.  * Popflash Training Script
  3.  * by S0lll0s and Bidj
  4.  * USAGE:
  5.  *  script_execute nadetraining
  6.  *  script nadeSetup()
  7.  *  bind "," "script nadeSavePos()"
  8.  * Press the key before every nade you save, all following nades will fly the same path
  9.  */
  10.  
  11. this.nadePos        <- null;
  12. this.nadeVel        <- null;
  13. this.nadeSaveMode   <- true;
  14. this.nadeLastNade   <- null;
  15.  
  16. function nadeSetup() {
  17.     printl( @"[NT] nadetraining.nut" );
  18.     printl( @"[NT] Popflash Training Script" );
  19.     printl( @"[NT] by S0lll0s and Bidj" );
  20.     printl( @"[NT] USAGE:" );
  21.     printl( @"[NT]   bind "","" ""script nadeSavePos()""" );
  22.     printl( @"[NT] Press the key before every nade you save, all following nades will fly the same path" );
  23.  
  24.     printl( @"[NT] starting setup..." );
  25.     SendToConsole( @"sv_cheats 1" );
  26.     SendToConsole( @"ent_remove nadeTimer" );
  27.     SendToConsole( @"ent_create logic_timer" );
  28.     SendToConsole( @"ent_fire logic_timer addoutput ""targetname nadeTimer""" );
  29.     SendToConsole( @"ent_fire nadeTimer toggle" );
  30.     SendToConsole( @"ent_fire nadeTimer addoutput ""refiretime 0.05""" );
  31.     SendToConsole( @"ent_fire nadeTimer enable" );
  32.     SendToConsole( @" ent_fire nadeTimer addoutput ""startdisabled 0""" );
  33.     SendToConsole( @" ent_fire nadeTimer addoutput ""UseRandomTime 0""" );
  34.     SendToConsole( @" ent_fire nadeTimer addoutput ""ontimer nadeTimer,RunScriptCode,nadeThink()""" );
  35.     printl( @"[NT] done. You can turn off sv_cheats now." );
  36. }
  37.  
  38. function nadeSavePos() {
  39.     nadeSaveMode = true;
  40.     ScriptPrintMessageCenterAll( "Saving next Flashbang or Grenade" );
  41. }
  42.  
  43. function nadeThink() {
  44.     local nade = null;
  45.  
  46.     while ( Entities.FindByClassname(nade, "flashbang_projectile") != null ) {
  47.         nade = Entities.FindByClassname(nade, "flashbang_projectile");
  48.         saveRestore( nade );
  49.     }
  50.    
  51.     nade = null;
  52.     while ( Entities.FindByClassname(nade, "hegrenade_projectile") != null ) {
  53.         nade = Entities.FindByClassname(nade, "hegrenade_projectile");
  54.         saveRestore( nade );
  55.     }
  56. }
  57.  
  58. function saveRestore( nade ) {
  59.     if ( nadeLastNade != nade ) {
  60.         if ( nadeSaveMode ) {
  61.             ScriptPrintMessageCenterAll( "Saved" );
  62.             nadePos = nade.GetCenter();
  63.             nadeVel = nade.GetVelocity();
  64.             nadeSaveMode = false;
  65.         } else {
  66.             nade.SetAbsOrigin( nadePos );
  67.             nade.SetVelocity( nadeVel );
  68.         }
  69.         nadeLastNade = nade;
  70.     }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement