Advertisement
BNutty07

main for 096

Nov 4th, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.17 KB | None | 0 0
  1. --[[ By: Brutez. ]]--
  2. local SCP096Script=script;
  3. repeat Wait(0);until script and script.Parent and script.Parent.ClassName=="Model"and script.Parent:FindFirstChild("Head")and script.Parent:FindFirstChild("Torso")and script.Parent:FindFirstChild("HumanoidRootPart");
  4. local SCP096=SCP096Script.Parent;
  5. if SCP096Script and SCP096 and SCP096:FindFirstChild("Thumbnail")then
  6. SCP096:FindFirstChild("Thumbnail"):Destroy();
  7. end
  8. local Hush=SCP096:FindFirstChild("Hush");
  9. local Notice=SCP096:FindFirstChild("Notice");
  10. local SCP096Humanoid;
  11. for _,Child in pairs(SCP096:GetChildren())do
  12. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  13. SCP096Humanoid=Child;
  14. end;
  15. end;
  16. local CanSee=false;
  17. local Pathing=false;
  18. local SCP096Head=SCP096:FindFirstChild("Head");
  19. local Damage5=SCP096Head:FindFirstChild("Damage5");
  20. local Idle=SCP096Head:FindFirstChild("Idle");
  21. local Panic=SCP096Head:FindFirstChild("Panic");
  22. local Screaming=SCP096Head:FindFirstChild("Screaming");
  23. local SCP096HumanoidRootPart=SCP096:FindFirstChild("HumanoidRootPart");
  24. local SCP096Torso=SCP096:FindFirstChild("Torso");
  25. local AttackDebounce=false;
  26. local Chasing=false;
  27. function raycast(Spos,vec,currentdist)
  28. local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(Spos+(vec*.05),vec*currentdist),SCP096);
  29. if hit2~=nil and pos2 then
  30. if hit2.Name=="Handle" and not hit2.CanCollide or string.sub(hit2.Name,1,6)=="Effect"and not hit2.CanCollide then
  31. local currentdist=currentdist-(pos2-Spos).magnitude;
  32. return raycast(pos2,vec,currentdist);
  33. end;
  34. end;
  35. return hit2,pos2;
  36. end;
  37. function RayCast(Position,Direction,MaxDistance,IgnoreList)
  38. return Game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position,Direction.unit*(MaxDistance or 999.999)),IgnoreList);
  39. end;
  40. Spawn(function()
  41. while Wait(0)do
  42. if SCP096Script and SCP096 and SCP096HumanoidRootPart and SCP096Head and SCP096Humanoid and SCP096Humanoid.Health~=0 then
  43. local TargetPoint=SCP096Humanoid.TargetPoint;
  44. local Blockage,BlockagePos=RayCast((SCP096HumanoidRootPart.CFrame+CFrame.new(SCP096HumanoidRootPart.Position,Vector3.new(TargetPoint.X,SCP096HumanoidRootPart.Position.Y,TargetPoint.Z)).lookVector*(SCP096HumanoidRootPart.Size.Z/2)).p,SCP096HumanoidRootPart.CFrame.lookVector,(SCP096HumanoidRootPart.Size.Z*2.5),{SCP096,SCP096})
  45. local Jumpable=false;
  46. if Blockage then
  47. Jumpable=true;
  48. if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then
  49. local BlockageHumanoid;
  50. for _,Child in pairs(Blockage.Parent:GetChildren())do
  51. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  52. BlockageHumanoid=Child;
  53. end;
  54. end;
  55. if Blockage and Blockage:IsA("Terrain")then
  56. local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0)));
  57. local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z);
  58. if CellMaterial==Enum.CellMaterial.Water then
  59. Jumpable=false;
  60. end;
  61. elseif BlockageHumanoid or Blockage.ClassName=="TrussPart"or Blockage.ClassName=="WedgePart"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Hat"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Tool"then
  62. Jumpable=false;
  63. end;
  64. end;
  65. if SCP096Script and SCP096 and SCP096Humanoid and SCP096Humanoid.Health~=0 and not SCP096Humanoid.Sit and Jumpable then
  66. SCP096Humanoid.Jump=true;
  67. end;
  68. end;
  69. end;
  70. end;
  71. end);
  72. local DynamicWander=true;
  73. while Wait(0)do
  74. if Game~=nil and Game:GetService("Workspace")~=nil and not Game:GetService("Workspace"):FindFirstChild("BrutezCredit")then
  75. local BrutezCredit=Instance.new("Hint",Game:GetService("Workspace"));
  76. BrutezCredit.Name="BrutezCredit";
  77. BrutezCredit.Text="The creator of this game wants to thank Brutez for his SCP-096 script! Kudos!";
  78. BrutezCredit.Archivable=false;
  79. end
  80. if SCP096Script and SCP096 and SCP096Humanoid then
  81. SCP096Humanoid.CameraOffset=Vector3.new(0,0,0);
  82. SCP096Humanoid.DisplayDistanceType="None";
  83. SCP096Humanoid.HealthDisplayDistance=0;
  84. SCP096Humanoid.Name="SCP";
  85. SCP096Humanoid.NameDisplayDistance=0;
  86. SCP096Humanoid.NameOcclusion="EnemyOcclusion";
  87. SCP096Humanoid.Archivable=true;
  88. SCP096Humanoid.AutoRotate=true;
  89. SCP096Humanoid.MaxHealth=99999e99999;
  90. SCP096Humanoid.Health=99999e99999;
  91. SCP096Humanoid.JumpPower=100;
  92. SCP096Humanoid.MaxSlopeAngle=89.9;
  93. if not Chasing then
  94. local SwitchWander=math.random(1,2000);
  95. if SwitchWander==1 and not DynamicWander then
  96. DynamicWander=true;
  97. elseif SwitchWander==1 and DynamicWander then
  98. DynamicWander=false;
  99. end;
  100. local WalkChance=math.random(1,100);
  101. if WalkChance==1 and SCP096Script and SCP096 and SCP096:FindFirstChild("Torso")and SCP096:FindFirstChild("Head")and SCP096Humanoid and SCP096Humanoid.Health~=0 and not DynamicWander then
  102. SCP096Humanoid:MoveTo(Game:GetService("Workspace"):FindFirstChild("Terrain").Position+Vector3.new(math.random(-2048,2048),0,math.random(-2048,2048)),Game:GetService("Workspace"):FindFirstChild("Terrain"));
  103. elseif SCP096Script and SCP096 and SCP096Torso and SCP096Head and SCP096Humanoid and SCP096Humanoid.Health~=0 and DynamicWander then
  104. local WanderAngle=(math.random()-0.5)*1;
  105. local RotatingLookVector=CFrame.Angles(0,WanderAngle,0)*SCP096Torso.CFrame.lookVector;
  106. SCP096Humanoid:MoveTo(SCP096Torso.Position+6*RotatingLookVector,SCP096Torso);
  107. end;
  108. SCP096Humanoid.WalkSpeed=10;
  109. else
  110. SCP096Humanoid=50;
  111. end;
  112. end;
  113. if SCP096Script and SCP096 and Hush and Hush.IsPlaying then
  114. Hush:Stop();
  115. end;
  116. if SCP096Script and SCP096 and Idle and not Idle.IsPlaying then
  117. Idle:Play();
  118. end;
  119. if SCP096Script and SCP096 and Panic and Panic.IsPlaying then
  120. Panic:Stop();
  121. end;
  122. if SCP096Script and SCP096 and Screaming and Screaming.IsPlaying then
  123. Screaming:Stop();
  124. end;
  125. local NoticeDistance=10;
  126. local TargetTorso;
  127. for _,TargetModel in pairs(Game:GetService("Workspace"):GetChildren())do
  128. if TargetModel.className=="Model"and TargetModel~=SCP096 and TargetModel.Name~=SCP096.Name and TargetModel:FindFirstChild("Torso")and TargetModel:FindFirstChild("Head")then
  129. local TargetPart=TargetModel:FindFirstChild("Torso");
  130. local FoundHumanoid;
  131. for _,Child in pairs(TargetModel:GetChildren())do
  132. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  133. FoundHumanoid=Child;
  134. end;
  135. end;
  136. if TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-SCP096HumanoidRootPart.Position).magnitude<NoticeDistance then
  137. TargetTorso=TargetPart;
  138. NoticeDistance=(TargetPart.Position-SCP096HumanoidRootPart.Position).magnitude;
  139. AttackDebounce=true;
  140. Spawn(function()
  141. Chasing=true;
  142. if SCP096Script and SCP096 and Idle then
  143. Notice:Play();
  144. end;
  145. if SCP096Script and SCP096 and Hush and Hush.IsPlaying then
  146. Hush:Stop();
  147. end;
  148. if SCP096Script and SCP096 and Idle and Idle.IsPlaying then
  149. Idle:Stop();
  150. end;
  151. if SCP096Script and SCP096 and Panic then
  152. Panic:Play();
  153. end;
  154. if SCP096Script and SCP096 and Screaming and Screaming.IsPlaying then
  155. Screaming:Stop();
  156. end;
  157. SCP096Humanoid.WalkSpeed=0;
  158. SCP096Humanoid:MoveTo(SCP096HumanoidRootPart.Position+(SCP096HumanoidRootPart.Position-SCP096HumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain"));
  159. Wait(30);
  160. if SCP096Script and SCP096 and Hush and not Hush.IsPlaying then
  161. Hush:Play();
  162. end;
  163. if SCP096Script and SCP096 and Idle and Idle.IsPlaying then
  164. Idle:Stop();
  165. end;
  166. if SCP096Script and SCP096 and Panic and Panic.IsPlaying then
  167. Panic:Stop();
  168. end;
  169. if SCP096Script and SCP096 and Screaming and not Screaming.IsPlaying then
  170. Screaming:Play();
  171. end;
  172. SCP096Humanoid.WalkSpeed=50;
  173. Spawn(function()
  174. while Wait(0)do
  175. local hit,pos=raycast(SCP096HumanoidRootPart.Position,(TargetPart.Position-SCP096HumanoidRootPart.Position).unit,500)
  176. if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("Torso")and hit.Parent:FindFirstChild("Head")then
  177. CanSee=true;
  178. else
  179. CanSee=false;
  180. end;
  181. end;
  182. end);
  183. repeat
  184. Wait(0)
  185. if CanSee then
  186. SCP096:FindFirstChild("MainAnimation"):FindFirstChild("CanSee").Value=true;
  187. SCP096Humanoid:MoveTo(TargetPart.Position+(TargetPart.Position-SCP096HumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain"));
  188. elseif not CanSee then
  189. SCP096:FindFirstChild("MainAnimation"):FindFirstChild("CanSee").Value=false;
  190. end;
  191. if not CanSee and not Pathing then
  192. Spawn(function()
  193. Pathing=true;
  194. local RenderedPath=game:GetService("PathfindingService"):ComputeRawPathAsync(SCP096Torso.Position,TargetPart.Position,500);
  195. local RenderedPathCoordinates=RenderedPath:GetPointCoordinates();
  196. for _=1,#RenderedPathCoordinates do
  197. if not CanSee then
  198. local Point=RenderedPathCoordinates[_];
  199. local PathTimer=0;
  200. repeat Wait(0);
  201. SCP096Humanoid:MoveTo(Point);PathTimer=PathTimer+1;
  202. if PathTimer>15 or CanSee then
  203. break;
  204. end;
  205. until(SCP096Torso.Position-Point).Magnitude<7 or PathTimer>15 or CanSee;
  206. if PathTimer>15 or CanSee then
  207. break;
  208. end;
  209. end;
  210. end;
  211. Pathing=false;
  212. end);
  213. end;
  214. if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and (TargetPart.Position-SCP096HumanoidRootPart.Position).magnitude<10 then
  215. Damage5:Play();
  216. FoundHumanoid:TakeDamage(99999e99999);
  217. end
  218. until TargetModel.Parent==nil or TargetPart.Parent==nil or FoundHumanoid.Parent==nil or TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health==0;
  219. Chasing=false;
  220. end);
  221. repeat Wait(0);until not Chasing;
  222. CanSee=false;
  223. AttackDebounce=false
  224. end;
  225. end;
  226. end;
  227. end;
  228. --[[ By: Brutez. ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement