Advertisement
KannyTheScriptEditor

stop clicking this!!

Nov 12th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. local humanoid = script.Parent:WaitForChild('Humanoid')
  2. local torso = script.Parent:WaitForChild('UpperTorso')
  3. local character = script.Parent
  4. local data = script.Parent.AnimationData
  5.  
  6. local debounce = false
  7. local damage = 60
  8. local waitTime = 2
  9.  
  10. local anim = humanoid:LoadAnimation(data:WaitForChild('Attack'))
  11.  
  12. local function wait(TimeToWait)
  13. if TimeToWait ~= nil then
  14. local TotalTime = 0
  15. TotalTime = TotalTime + game:GetService("RunService").Heartbeat:wait()
  16. while TotalTime < TimeToWait do
  17. TotalTime = TotalTime + game:GetService("RunService").Heartbeat:wait()
  18. end
  19. else
  20. game:GetService("RunService").Heartbeat:wait()
  21. end
  22. end
  23.  
  24. function findTarget()
  25. local target
  26. local dist = 200
  27. for _, p in pairs(workspace:GetChildren()) do
  28. if p:IsA('Model')
  29. and p ~= script.Parent
  30. and p.Name ~= 'SCP-008 Infected'
  31. and p.Name ~= '[INFECTED]'.. script.Parent.Name
  32. and p.Name ~= 'SCP-049'
  33. and p.Name ~= 'SCP-049-2'
  34. and p.Name ~= 'SCP-053'
  35. and p.Name ~= 'SCP-058'
  36. and p.Name ~= 'SCP-073'
  37. and p.Name ~= 'SCP-076-2'
  38. and p.Name ~= 'SCP-096'
  39. and p.Name ~= 'SCP-105'
  40. and p.Name ~= 'SCP-106'
  41. and p.Name ~= 'SCP-178-1'
  42. and p.Name ~= 'SCP-372'
  43. and p.Name ~= 'SCP-457'
  44. and p.Name ~= 'SCP-513-1'
  45. and p.Name ~= 'SCP-682'
  46. and p.Name ~= 'SCP-860-2'
  47. and p.Name ~= 'SCP-939'
  48. and p.Name ~= 'SCP-953'
  49. and p.Name ~= 'SCP-966'
  50. and p.Name ~= 'SCP-1048'
  51. and p.Name ~= 'SCP-1048-A' then
  52. local h = p:FindFirstChild('Humanoid')
  53. if h and h.Health > 0 then
  54. if h.RigType == Enum.HumanoidRigType.R6 then
  55. local t = p:FindFirstChild('Torso')
  56. if t and (t.Position - torso.Position).magnitude <= dist then
  57. target = t
  58. dist = (t.Position - torso.Position).magnitude
  59. end
  60. elseif h.RigType == Enum.HumanoidRigType.R15 then
  61. local t = p:FindFirstChild('UpperTorso')
  62. if t and (t.Position - torso.Position).magnitude <= dist then
  63. target = t
  64. dist = (t.Position - torso.Position).magnitude
  65. end
  66. end
  67. end
  68. end
  69. end
  70. return target
  71. end
  72.  
  73. for _, part in pairs(script.Parent:GetChildren()) do
  74. if part:IsA('BasePart') then
  75. part.Touched:connect(function(hit)
  76. if humanoid.Health > 0
  77. and not debounce
  78. and hit.Parent.Name ~= 'SCP-008 Infected'
  79. and hit.Parent.Name ~= 'SCP-049'
  80. and hit.Parent.Name ~= 'SCP-049-2'
  81. and hit.Parent.Name ~= 'SCP-053'
  82. and hit.Parent.Name ~= 'SCP-058'
  83. and hit.Parent.Name ~= 'SCP-073'
  84. and hit.Parent.Name ~= 'SCP-076-2'
  85. and hit.Parent.Name ~= 'SCP-096'
  86. and hit.Parent.Name ~= 'SCP-105'
  87. and hit.Parent.Name ~= 'SCP-106'
  88. and hit.Parent.Name ~= 'SCP-178-1'
  89. and hit.Parent.Name ~= 'SCP-372'
  90. and hit.Parent.Name ~= 'SCP-457'
  91. and hit.Parent.Name ~= 'SCP-513-1'
  92. and hit.Parent.Name ~= 'SCP-682'
  93. and hit.Parent.Name ~= 'SCP-860-2'
  94. and hit.Parent.Name ~= 'SCP-939'
  95. and hit.Parent.Name ~= 'SCP-953'
  96. and hit.Parent.Name ~= 'SCP-966'
  97. and hit.Parent.Name ~= 'SCP-1048'
  98. and hit.Parent.Name ~= 'SCP-1048-A' then
  99. local h = hit.Parent:FindFirstChild('Humanoid')
  100. if h and h.Health > 0 then
  101. debounce = true
  102. h:TakeDamage(damage)
  103. if not hit.Parent:FindFirstChild('SCP008Effect') then
  104. local scr = script.SCP008Effect:Clone()
  105. scr.Parent = hit.Parent
  106. scr.Disabled = false
  107. end
  108. anim:Play(nil, nil, 2)
  109. torso['Attack'..math.random(1, 3)]:Play()
  110. wait(waitTime)
  111. debounce = false
  112. end
  113. end
  114. end)
  115. end
  116. end
  117.  
  118. humanoid.Died:connect(function()
  119. wait(5)
  120. script.Parent:Destroy()
  121. end)
  122. humanoid.Changed:Connect(function()
  123. if humanoid.Sit then wait(5) humanoid.Sit = false end
  124. if humanoid.PlatformStand then wait(5) humanoid.PlatformStand = false end
  125. end)
  126.  
  127. while humanoid.Health > 0 do
  128. wait(0.1)
  129. local target = findTarget()
  130. if target then
  131. humanoid:MoveTo(target.Position)
  132. end
  133. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement