skroton

Untitled

May 28th, 2014
181
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. If using svn build use ChangeActorPitch instead of SetActorPitch so you can interpolate movement
  2.  
  3. script "Recoil" (int ResetRecoil)
  4. {
  5. int originalpitch = GetActorPitch(0);
  6. int newpitch = 0;
  7. int originalangle = GetActorAngle(0);
  8. int newangle = 0;
  9. int LeftorRight = Random(0,1);
  10.  
  11. if(LeftorRight > 0)
  12. {
  13. newpitch = (originalpitch - random(0.01,0.03));
  14. SetActorPitch(0,newpitch);
  15. newangle = (originalangle + random(0.001,0.003));
  16. SetActorAngle(0,newangle);
  17. Delay(1);
  18.  
  19. newpitch = (newpitch - random(0.01,0.03));
  20. SetActorPitch(0,newpitch);
  21. newangle = (newangle + random(0.001,0.003));
  22. SetActorAngle(0,newangle);
  23. Delay(1);
  24.  
  25. newpitch = (newpitch - random(0.01,0.03));
  26. SetActorPitch(0,newpitch);
  27. newangle = (newangle + random(0.001,0.003));
  28. SetActorAngle(0,newangle);
  29. Delay(1);
  30.  
  31. newpitch = (newpitch - random(0.01,0.03));
  32. SetActorPitch(0,newpitch);
  33. newangle = (newangle + random(0.001,0.003));
  34. SetActorAngle(0,newangle);
  35. Delay(1);
  36.  
  37. newpitch = (newpitch - random(0.01,0.03));
  38. SetActorPitch(0,newpitch);
  39. newangle = (newangle + random(0.001,0.003));
  40. SetActorAngle(0,newangle);
  41. Delay(1);
  42.  
  43. newpitch = (newpitch - random(0.01,0.03));
  44. SetActorPitch(0,newpitch);
  45. newangle = (newangle + random(0.001,0.003));
  46. SetActorAngle(0,newangle);
  47. Delay(1);
  48.  
  49. newpitch = (newpitch - random(0.01,0.03));
  50. SetActorPitch(0,newpitch);
  51. newangle = (newangle + random(0.001,0.003));
  52. SetActorAngle(0,newangle);
  53. Delay(1);
  54.  
  55. newpitch = (newpitch - random(0.01,0.03));
  56. SetActorPitch(0,newpitch);
  57. newangle = (newangle + random(0.001,0.003));
  58. SetActorAngle(0,newangle);
  59. Delay(1);
  60.  
  61. newpitch = (newpitch - random(0.01,0.03));
  62. SetActorPitch(0,newpitch);
  63. newangle = (newangle + random(0.001,0.003));
  64. SetActorAngle(0,newangle);
  65. Delay(1);
  66.  
  67. if(ResetRecoil > 0)
  68. {
  69. SetActorPitch(0,originalpitch);
  70. SetActorAngle(0,originalangle);
  71. Terminate;
  72. }
  73. else
  74. {
  75. Terminate;
  76. }
  77. }
  78.  
  79. else
  80. {
  81. newpitch = (originalpitch - random(0.01,0.03));
  82. SetActorPitch(0,newpitch);
  83. newangle = (originalangle - random(0.001,0.003));
  84. SetActorAngle(0,newangle);
  85. Delay(1);
  86.  
  87. newpitch = (newpitch - random(0.01,0.03));
  88. SetActorPitch(0,newpitch);
  89. newangle = (newangle - random(0.001,0.003));
  90. SetActorAngle(0,newangle);
  91. Delay(1);
  92.  
  93. newpitch = (newpitch - random(0.01,0.03));
  94. SetActorPitch(0,newpitch);
  95. newangle = (newangle - random(0.001,0.003));
  96. SetActorAngle(0,newangle);
  97. Delay(1);
  98.  
  99. newpitch = (newpitch - random(0.01,0.03));
  100. SetActorPitch(0,newpitch);
  101. newangle = (newangle - random(0.001,0.003));
  102. SetActorAngle(0,newangle);
  103. Delay(1);
  104.  
  105. newpitch = (newpitch - random(0.01,0.03));
  106. SetActorPitch(0,newpitch);
  107. newangle = (newangle - random(0.001,0.003));
  108. SetActorAngle(0,newangle);
  109. Delay(1);
  110.  
  111. newpitch = (newpitch - random(0.01,0.03));
  112. SetActorPitch(0,newpitch);
  113. newangle = (newangle - random(0.001,0.003));
  114. SetActorAngle(0,newangle);
  115. Delay(1);
  116.  
  117. newpitch = (newpitch - random(0.01,0.03));
  118. SetActorPitch(0,newpitch);
  119. newangle = (newangle - random(0.001,0.003));
  120. SetActorAngle(0,newangle);
  121. Delay(1);
  122.  
  123. newpitch = (newpitch - random(0.01,0.03));
  124. SetActorPitch(0,newpitch);
  125. newangle = (newangle - random(0.001,0.003));
  126. SetActorAngle(0,newangle);
  127. Delay(1);
  128.  
  129. newpitch = (newpitch - random(0.01,0.03));
  130. SetActorPitch(0,newpitch);
  131. newangle = (newangle - random(0.001,0.003));
  132. SetActorAngle(0,newangle);
  133. Delay(1);
  134.  
  135. if(ResetRecoil > 0)
  136. {
  137. SetActorPitch(0,originalpitch);
  138. SetActorAngle(0,originalangle);
  139. Terminate;
  140. }
  141. else
  142. {
  143. Terminate;
  144. }
  145. }
  146. }
RAW Paste Data