Advertisement
BNutty07

anim for 096

Nov 4th, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.76 KB | None | 0 0
  1. --[[ By: Brutez. ]]--
  2. local AnimationScript=script;
  3. repeat Wait(0);until script and script.ClassName=="Script"and script.Parent and script.Parent.ClassName=="Model"and script.Parent:FindFirstChild("Torso")and script.Parent:FindFirstChild("Head");
  4. local SCP096=AnimationScript.Parent;
  5. local SCP096Torso=SCP096:FindFirstChild("Torso");
  6. local LeftHip=SCP096Torso:FindFirstChild("Left Hip");
  7. local LeftShoulder=SCP096Torso:FindFirstChild("Left Shoulder");
  8. local Neck=SCP096Torso:FindFirstChild("Neck");
  9. local RightHip=SCP096Torso:FindFirstChild("Right Hip");
  10. local RightShoulder=SCP096Torso:FindFirstChild("Right Shoulder");
  11. local SCP096Humanoid;
  12. for _,Child in pairs(SCP096:GetChildren())do
  13. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  14. SCP096Humanoid=Child;
  15. end;
  16. end;
  17. local CurrentPose="WhaaPose";
  18. local CurrentToolAnimation="None";
  19. local CurrentToolAnimationTime=0;
  20. function AquireTool()
  21. for _,Child in ipairs(SCP096:GetChildren()) do
  22. if Child and Child~=nil and Child.className=="Tool"then
  23. return Child;
  24. end;
  25. end;
  26. end;
  27. function AquireToolAnimation(ToolChild)
  28. for _,Child in ipairs(ToolChild:GetChildren()) do
  29. if Child and Child~=nil and Child.Name=="toolanim"and Child.className=="StringValue"then
  30. return Child;
  31. end;
  32. end;
  33. end;
  34. function ToolAnimation()
  35. if CurrentToolAnimation=="None"then
  36. RightShoulder.DesiredAngle=1.57;
  37. return;
  38. elseif CurrentToolAnimation=="Slash"then
  39. RightShoulder.MaxVelocity=0.5;
  40. RightShoulder.DesiredAngle=0;
  41. return;
  42. elseif CurrentToolAnimation=="Lunge"then
  43. RightShoulder.MaxVelocity=0.5;
  44. LeftShoulder.MaxVelocity=0.5;
  45. RightHip.MaxVelocity=0.5;
  46. LeftHip.MaxVelocity=0.5;
  47. RightShoulder.DesiredAngle=1.57;
  48. LeftShoulder.DesiredAngle=1.0;
  49. RightHip.DesiredAngle=1.57;
  50. LeftHip.DesiredAngle=1.0;
  51. return;
  52. end;
  53. end;
  54. function ChangeAngle(time)
  55. local Amount;
  56. local Rate;
  57. local Angle;
  58. if CurrentPose=="Jumping"then
  59. LeftHip.MaxVelocity=0.5;
  60. LeftHip.DesiredAngle=0;
  61. LeftShoulder.CurrentAngle=-3.14;
  62. LeftShoulder.DesiredAngle=-3.14;
  63. Neck.MaxVelocity=5;
  64. Neck.DesiredAngle=0;
  65. RightHip.MaxVelocity=0.5;
  66. RightHip.DesiredAngle=0;
  67. RightShoulder.CurrentAngle=3.14;
  68. RightShoulder.MaxVelocity=0.5;
  69. RightShoulder.DesiredAngle=3.14;
  70. Amount=nil;
  71. Rate=nil;
  72. Angle=nil;
  73. elseif CurrentPose=="FreeFall"then
  74. LeftHip.MaxVelocity=0.5;
  75. LeftHip.DesiredAngle=0;
  76. LeftShoulder.MaxVelocity=0.5;
  77. LeftShoulder.DesiredAngle=-3.14;
  78. Neck.MaxVelocity=5;
  79. Neck.DesiredAngle=0;
  80. RightHip.MaxVelocity=0.5;
  81. RightHip.DesiredAngle=0;
  82. RightShoulder.MaxVelocity=0.5;
  83. RightShoulder.DesiredAngle=3.14;
  84. Amount=nil;
  85. Rate=nil;
  86. Angle=nil;
  87. elseif CurrentPose=="Sitting"then
  88. LeftHip.MaxVelocity=0.15;
  89. LeftHip.DesiredAngle=-3.14/2;
  90. LeftShoulder.MaxVelocity=0.15;
  91. LeftShoulder.DesiredAngle=-3.14/2;
  92. Neck.MaxVelocity=0.15;
  93. Neck.DesiredAngle=0;
  94. RightHip.MaxVelocity=0.15;
  95. RightHip.DesiredAngle=3.14/2;
  96. RightShoulder.MaxVelocity=0.15;
  97. RightShoulder.DesiredAngle=3.14/2;
  98. Amount=nil;
  99. Rate=nil;
  100. Angle=nil;
  101. elseif CurrentPose=="Walking"then
  102. LeftHip.MaxVelocity=0.2;
  103. LeftShoulder.MaxVelocity=0.2;
  104. Neck.MaxVelocity=0.02;
  105. RightHip.MaxVelocity=0.2;
  106. RightShoulder.MaxVelocity=0.2;
  107. Amount=0.4;
  108. Rate=2;
  109. Angle=0;
  110. elseif CurrentPose=="Running"then
  111. if script.CanSee.Value then
  112. LeftHip.MaxVelocity=0.4;
  113. LeftShoulder.MaxVelocity=0.4;
  114. LeftShoulder.DesiredAngle=-3.14/2;
  115. Neck.MaxVelocity=1;
  116. RightHip.MaxVelocity=0.4;
  117. RightShoulder.MaxVelocity=0.4;
  118. RightShoulder.DesiredAngle=3.14/2;
  119. Amount=2;
  120. Rate=15;
  121. Angle=0;
  122. elseif not script.CanSee.Value then
  123. LeftHip.MaxVelocity=0.4;
  124. LeftShoulder.MaxVelocity=0.4;
  125. LeftShoulder.DesiredAngle=3.14/2;
  126. Neck.MaxVelocity=1;
  127. RightHip.MaxVelocity=0.4;
  128. RightShoulder.MaxVelocity=0.4;
  129. RightShoulder.DesiredAngle=-3.14/2;
  130. Amount=2;
  131. Rate=15;
  132. Angle=0;
  133. end;
  134. elseif CurrentPose=="Panic"then
  135. LeftHip.DesiredAngle=0;
  136. LeftHip.MaxVelocity=1;
  137. LeftShoulder.DesiredAngle=-3.14;
  138. LeftShoulder.MaxVelocity=1;
  139. Neck.DesiredAngle=0;
  140. Neck.MaxVelocity=0.3;
  141. RightHip.DesiredAngle=0;
  142. RightHip.MaxVelocity=1;
  143. RightShoulder.MaxVelocity=1;
  144. RightShoulder.DesiredAngle=3.14;
  145. Amount=1;
  146. Rate=10;
  147. Angle=0;
  148. elseif CurrentPose=="Climbing"then
  149. LeftHip.MaxVelocity=0.7;
  150. LeftShoulder.MaxVelocity=0.15;
  151. Neck.MaxVelocity=1;
  152. RightHip.MaxVelocity=0.7;
  153. RightShoulder.MaxVelocity=0.15;
  154. Amount=1;
  155. Rate=9;
  156. Angle=3.14;
  157. elseif CurrentPose=="Platformed"then
  158. LeftHip.DesiredAngle=0;
  159. LeftHip.CurrentAngle=0;
  160. LeftHip.MaxVelocity=0;
  161. LeftShoulder.DesiredAngle=0;
  162. LeftShoulder.CurrentAngle=0;
  163. LeftShoulder.MaxVelocity=0;
  164. Neck.DesiredAngle=0;
  165. Neck.CurrentAngle=0;
  166. Neck.MaxVelocity=0;
  167. RightHip.DesiredAngle=0;
  168. RightHip.CurrentAngle=0;
  169. RightHip.MaxVelocity=0;
  170. RightShoulder.MaxVelocity=0;
  171. RightShoulder.DesiredAngle=0;
  172. RightShoulder.CurrentAngle=0;
  173. Amount=nil;
  174. Rate=nil;
  175. Angle=nil;
  176. elseif CurrentPose=="WhaaPose"then
  177. LeftHip.MaxVelocity=0.05;
  178. LeftShoulder.MaxVelocity=0.05;
  179. Neck.MaxVelocity=0.005;
  180. RightHip.MaxVelocity=0.05;
  181. RightShoulder.MaxVelocity=0.05;
  182. Amount=0.1;
  183. Rate=3;
  184. Angle=0;
  185. end;
  186. if CurrentPose~="Platformed"or CurrentPose~="Jumping"or CurrentPose~="FreeFalling"or CurrentPose~="Sitting"then
  187. if Amount and Amount~=nil and Rate and Rate~=nil and Angle and Angle~=nil then
  188. local DesiredAngle=Amount*math.sin(time*Rate);
  189. if CurrentPose~="Running"then
  190. Neck.DesiredAngle=DesiredAngle;
  191. end;
  192. if CurrentPose~="Running"and CurrentPose~="Panic"then
  193. RightShoulder.DesiredAngle=DesiredAngle+Angle;
  194. LeftShoulder.DesiredAngle=DesiredAngle-Angle;
  195. end;
  196. if CurrentPose~="Panic"then
  197. RightHip.DesiredAngle=-DesiredAngle;
  198. LeftHip.DesiredAngle=-DesiredAngle;
  199. end;
  200. end;
  201. local CurrentTool=AquireTool();
  202. if CurrentTool and CurrentTool~=nil then
  203. local animStringValueObject=AquireToolAnimation(CurrentTool);
  204. if animStringValueObject then
  205. CurrentToolAnimation=animStringValueObject.Value;
  206. animStringValueObject.Parent=nil;
  207. CurrentToolAnimationTime=time+0.3;
  208. end;
  209. if time>CurrentToolAnimationTime then
  210. CurrentToolAnimationTime=0
  211. CurrentToolAnimation="None"
  212. end;
  213. ToolAnimation();
  214. else
  215. CurrentToolAnimation="None";
  216. CurrentToolAnimationTime=0;
  217. end;
  218. end;
  219. end;
  220. Spawn(function()
  221. while Wait(0)do
  222. if AnimationScript and SCP096 and SCP096Torso and SCP096Torso~=nil then
  223. local FiredRay=Ray.new(SCP096Torso.Position,Vector3.new(0,-5.5,0));
  224. local RayTarget,endPoint=Game:GetService("Workspace"):FindPartOnRay(FiredRay,SCP096);
  225. if RayTarget and(SCP096Torso.Velocity-Vector3.new(0,SCP096Torso.Velocity.y,0)).magnitude>=5 and SCP096Humanoid and SCP096Humanoid.WalkSpeed==10 and not SCP096Humanoid.Sit and not SCP096Humanoid.PlatformStand then
  226. CurrentPose="Walking";
  227. elseif RayTarget and(SCP096Torso.Velocity-Vector3.new(0,SCP096Torso.Velocity.y,0)).magnitude>=5 and SCP096Humanoid and SCP096Humanoid.WalkSpeed==50 and not SCP096Humanoid.Sit and not SCP096Humanoid.PlatformStand then
  228. CurrentPose="Running";
  229. elseif SCP096Humanoid and SCP096Humanoid.Sit and not SCP096Humanoid.PlatformStand then
  230. CurrentPose="Sitting";
  231. elseif not RayTarget and SCP096Humanoid and not SCP096Humanoid.Sit and not SCP096Humanoid.PlatformStand then
  232. CurrentPose="Jumping";
  233. elseif SCP096Humanoid and SCP096Humanoid.PlatformStand then
  234. CurrentPose="Platformed";
  235. elseif RayTarget and(SCP096Torso.Velocity-Vector3.new(0,SCP096Torso.Velocity.y,0)).magnitude<=5 and SCP096Humanoid and SCP096Humanoid.WalkSpeed==0 and not SCP096Humanoid.Sit and not SCP096Humanoid.PlatformStand then
  236. CurrentPose="Panic";
  237. else
  238. CurrentPose="WhaaPose";
  239. end;
  240. end;
  241. end;
  242. end);
  243. while Wait(0)do
  244. if Game~=nil and Game:GetService("Workspace")~=nil and not Game:GetService("Workspace"):FindFirstChild("BrutezCredit")then
  245. local BrutezCredit=Instance.new("Hint",Game:GetService("Workspace"));
  246. BrutezCredit.Name="BrutezCredit";
  247. BrutezCredit.Text="The creator of this game wants to thank Brutez for his SCP-096 script! Kudos!";
  248. BrutezCredit.Archivable=false;
  249. end
  250. if SCP096 then
  251. local _,time=Wait(0);
  252. ChangeAngle(time);
  253. else
  254. break;
  255. end;
  256. end;
  257. --[[ By: Brutez. ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement