Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.53 KB | None | 0 0
  1. -- Made by Sxnned
  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 SCP096Script and SCP096 and SCP096Humanoid then
  75. SCP096Humanoid.CameraOffset=Vector3.new(0,0,0);
  76. SCP096Humanoid.DisplayDistanceType="None";
  77. SCP096Humanoid.HealthDisplayDistance=0;
  78. SCP096Humanoid.Name="SCP";
  79. SCP096Humanoid.NameDisplayDistance=0;
  80. SCP096Humanoid.NameOcclusion="EnemyOcclusion";
  81. SCP096Humanoid.Archivable=true;
  82. SCP096Humanoid.AutoRotate=true;
  83. SCP096Humanoid.MaxHealth=99999e99999;
  84. SCP096Humanoid.Health=99999e99999;
  85. SCP096Humanoid.JumpPower=0;
  86. SCP096Humanoid.MaxSlopeAngle=90;
  87. if not Chasing then
  88. local SwitchWander=math.random(1,2000);
  89. if SwitchWander==1 and not DynamicWander then
  90. DynamicWander=true;
  91. elseif SwitchWander==1 and DynamicWander then
  92. DynamicWander=false;
  93. end;
  94. local WalkChance=math.random(1,100);
  95. if WalkChance==2 and SCP096Script and SCP096 and SCP096:FindFirstChild("Torso")and SCP096:FindFirstChild("Head")and SCP096Humanoid and SCP096Humanoid.Health~=0 and not DynamicWander then
  96. SCP096Humanoid:MoveTo(Game:GetService("Workspace"):FindFirstChild("Terrain").Position+Vector3.new(math.random(-2048,2048),0,math.random(-2048,2048)),Game:GetService("Workspace"):FindFirstChild("Terrain"));
  97. elseif SCP096Script and SCP096 and SCP096Torso and SCP096Head and SCP096Humanoid and SCP096Humanoid.Health~=0 and DynamicWander then
  98. local WanderAngle=(math.random()-0.5)*1;
  99. local RotatingLookVector=CFrame.Angles(0,WanderAngle,0)*SCP096Torso.CFrame.lookVector;
  100. SCP096Humanoid:MoveTo(SCP096Torso.Position+9*RotatingLookVector,SCP096Torso);
  101. end;
  102. SCP096Humanoid.WalkSpeed=3;
  103. else
  104. SCP096Humanoid=35;
  105. end;
  106. end;
  107. if SCP096Script and SCP096 and Hush and Hush.IsPlaying then
  108. Hush:Stop();
  109. end;
  110. if SCP096Script and SCP096 and Idle and not Idle.IsPlaying then
  111. Idle:Play();
  112. end;
  113. if SCP096Script and SCP096 and Panic and Panic.IsPlaying then
  114. Panic:Stop();
  115. end;
  116. if SCP096Script and SCP096 and Screaming and Screaming.IsPlaying then
  117. Screaming:Stop();
  118. end;
  119. local NoticeDistance=5;
  120. local TargetTorso;
  121. for _,TargetModel in pairs(Game:GetService("Workspace"):GetChildren())do
  122. if TargetModel.className=="Model"and TargetModel~=SCP096 and TargetModel.Name~=SCP096.Name and TargetModel:FindFirstChild("Torso")and TargetModel:FindFirstChild("Head")then
  123. local TargetPart=TargetModel:FindFirstChild("Torso");
  124. local FoundHumanoid;
  125. for _,Child in pairs(TargetModel:GetChildren())do
  126. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  127. FoundHumanoid=Child;
  128. end;
  129. end;
  130. if TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-SCP096HumanoidRootPart.Position).magnitude<NoticeDistance then
  131. TargetTorso=TargetPart;
  132. NoticeDistance=(TargetPart.Position-SCP096HumanoidRootPart.Position).magnitude;
  133. AttackDebounce=true;
  134. Spawn(function()
  135. Chasing=true;
  136. if SCP096Script and SCP096 and Idle then
  137. Notice:Play();
  138. end;
  139. if SCP096Script and SCP096 and Hush and Hush.IsPlaying then
  140. Hush:Stop();
  141. end;
  142. if SCP096Script and SCP096 and Idle and Idle.IsPlaying then
  143. Idle:Stop();
  144. end;
  145. if SCP096Script and SCP096 and Panic then
  146. Panic:Play();
  147. end;
  148. if SCP096Script and SCP096 and Screaming and Screaming.IsPlaying then
  149. Screaming:Stop();
  150. end;
  151. SCP096Humanoid.WalkSpeed=0;
  152. SCP096Humanoid:MoveTo(SCP096Torso.Position,Game:GetService("Workspace"):FindFirstChild("Terrain"));
  153. Wait(38);
  154. if SCP096Script and SCP096 and Hush and not Hush.IsPlaying then
  155. Hush:Play();
  156. end;
  157. if SCP096Script and SCP096 and Idle and Idle.IsPlaying then
  158. Idle:Stop();
  159. end;
  160. if SCP096Script and SCP096 and Panic and Panic.IsPlaying then
  161. Panic:Stop();
  162. end;
  163. if SCP096Script and SCP096 and Screaming and not Screaming.IsPlaying then
  164. Screaming:Play();
  165. end;
  166. SCP096Humanoid.WalkSpeed=35;
  167. Spawn(function()
  168. while Wait(0)do
  169. local hit,pos=raycast(SCP096HumanoidRootPart.Position,(TargetPart.Position-SCP096HumanoidRootPart.Position).unit,500)
  170. if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("Torso")and hit.Parent:FindFirstChild("Head")then
  171. CanSee=true;
  172. else
  173. CanSee=false;
  174. end;
  175. end;
  176. end);
  177. repeat
  178. Wait(0)
  179. if CanSee then
  180. SCP096Humanoid:MoveTo(TargetPart.Position+(TargetPart.Position-SCP096HumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain"));
  181. end;
  182. if not CanSee and not Pathing then
  183. Spawn(function()
  184. Pathing=true;
  185. local RenderedPath=game:GetService("PathfindingService"):ComputeRawPathAsync(SCP096Torso.Position,TargetPart.Position,500);
  186. local RenderedPathCoordinates=RenderedPath:GetPointCoordinates();
  187. for _=1,#RenderedPathCoordinates do
  188. if not CanSee then
  189. local Point=RenderedPathCoordinates[_];
  190. local PathTimer=0;
  191. repeat Wait(0);
  192. SCP096Humanoid:MoveTo(Point);PathTimer=PathTimer+1;
  193. if PathTimer>15 or CanSee then
  194. break;
  195. end;
  196. until(SCP096Torso.Position-Point).Magnitude<5 or PathTimer>15 or CanSee;
  197. if PathTimer>15 or CanSee then
  198. break;
  199. end;
  200. end;
  201. end;
  202. Pathing=false;
  203. end);
  204. end;
  205. if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and (TargetPart.Position-SCP096HumanoidRootPart.Position).magnitude<10 then
  206. Damage5:Play();
  207. FoundHumanoid:TakeDamage(99999e99999);
  208. end
  209. until TargetModel.Parent==nil or TargetPart.Parent==nil or FoundHumanoid.Parent==nil or TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health==0;
  210. Chasing=false;
  211. end);
  212. repeat Wait(0);until not Chasing;
  213. AttackDebounce=false
  214. end;
  215. end;
  216. end;
  217. end;
  218. --[[ By: Brutez. ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement