Advertisement
Bagura32rus

T2 PUBG x4

Jul 16th, 2019
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. #pragma METAINFO("AwesomeAntiRecoil", 1, 0, "bonefisher")
  2.  
  3. /* Special credits goes out to AryanX for a awesome anti-recoil script!*/
  4. #define float fix32
  5.  
  6. //Anti Recoil
  7. bool bUseAntiRecoil = TRUE;
  8. float ARecoil_H_Standing = 0.0;// Change horizontal force add negative if needed.
  9. float ARecoil_V_Standing = 49.0;//Change vertical pull force
  10. uint16 ARecoilDelay = 75;//Change delay after trigger is pulled to engage anti-recoil.
  11.  
  12. //Percent of anti ARecoil to always apply regardless of aim movement
  13. float MinARecoilPercent = 30.0;
  14.  
  15. float StickNoise = 6.32;
  16.  
  17. main {
  18. //////////////////////////////////////////////////////////////////////////
  19. //Anti Recoil
  20. //////////////////////////////////////////////////////////////////////////
  21. if (bUseAntiRecoil)
  22. {
  23.  
  24. if (get_actual(BUTTON_8) &&get_actual(BUTTON_5) && time_active(BUTTON_5) >= ARecoilDelay)
  25. {
  26.  
  27. if (abs(get_actual(STICK_1_X)) < StickNoise) set_val(STICK_1_X, 0.0);
  28. if (abs(get_actual(STICK_1_Y)) < StickNoise) set_val(STICK_1_Y, 0.0);
  29. if (abs(get_actual(STICK_2_X)) < StickNoise) set_val(STICK_2_X, 0.0);
  30. if (abs(get_actual(STICK_2_Y)) < StickNoise) set_val(STICK_2_Y, 0.0);
  31.  
  32. if (get_actual(BUTTON_8) && get_val(BUTTON_5))
  33. {
  34. AntiRecoil(STICK_1_X, ARecoil_H_Standing);
  35. AntiRecoil(STICK_1_Y, ARecoil_V_Standing);
  36. }
  37. }
  38. }
  39. }
  40.  
  41. void AntiRecoil(uint8 AxisToApply, float ARecoilToApply)
  42. {
  43. float CurrentX = get_val(STICK_1_X);
  44. float CurrentY = get_val(STICK_1_Y);
  45. float MinARecoilFactor = MinARecoilPercent / 100.0;
  46. float MinARecoilToApply = MinARecoilFactor * ARecoilToApply;
  47. //This sets the ARecoil to be dependent on both X and Y axis movement. With more emphasis on Y
  48. float MovementARecoilToApply = (1.0 - MinARecoilFactor) * ((ARecoilToApply * (100.0 - sqrt(CurrentX*CurrentX + CurrentY*CurrentY))) / (100.0 + abs(CurrentX) + (CurrentY*CurrentY*0.5)));
  49. set_val(AxisToApply, MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply));
  50. }
  51.  
  52. bool run_flag;
  53.  
  54. main
  55. {
  56. if(!get_actual(BUTTON_5) && !get_actual(BUTTON_8) && !run_flag &&
  57. get_val(STICK_2_Y) < -99.0 && time_active(STICK_2_Y) > 300) {
  58. run_flag = 1;
  59. combo_run(run);
  60. }else if(get_val(STICK_2_Y) > -99.0 && event_release(STICK_2_Y)) {
  61. run_flag = 0;
  62. }
  63. }
  64.  
  65. combo run
  66. {
  67. set_val(BUTTON_9, 0.0);
  68. wait(200);
  69. set_val(BUTTON_9, 100.0);
  70. wait(400);
  71. set_val(BUTTON_9, 0.0);
  72. }
  73. bool toggle;
  74.  
  75. main {
  76. // VIEW + RT to toggle rapidfire
  77. if(get_val(BUTTON_2) && event_active(BUTTON_5)) {
  78. toggle = !toggle;
  79. }
  80.  
  81. if(toggle) {
  82. if(get_val(BUTTON_5)) {
  83. combo_run(Rapidfire);
  84. }
  85. }
  86.  
  87.  
  88. }
  89.  
  90. combo Rapidfire {
  91. set_val(BUTTON_5, 100.0);
  92. wait(28);
  93. set_val(BUTTON_5, 0.0);
  94. wait(16);
  95. set_val(BUTTON_5, 0.0);
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement