Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.22 KB | None | 0 0
  1. local soundIds = {150185006,150184965,150185025}
  2. local sounds = {}
  3. for i=1,#soundIds do
  4. local s = Instance.new("Sound")
  5. s.SoundId = "http://www.roblox.com/asset/?id=" .. soundIds[i]
  6. s.Volume = 1
  7. s.Parent = script.Parent
  8. sounds[#sounds + 1] = s
  9. end
  10. fpor = game.Workspace.FindPartOnRay
  11. seen_dist = 200
  12. function canSee(subject,viewer)
  13. if (not subject) or (not viewer) then return false end
  14. local sh = subject:findFirstChild("Death")
  15. local vh = viewer:findFirstChild("Head")
  16. if (not sh) or (not vh) then return false end
  17. local vec = sh.Position - vh.Position
  18. local isInFOV = (vec:Dot(vh.CFrame.lookVector) > 0)
  19. if (isInFOV) and (vec.magnitude < seen_dist) then
  20. local ray = Ray.new(vh.Position,vec.unit*200)
  21. local por = fpor(workspace,ray,viewer,false)
  22. return (por == nil) or (por:IsDescendantOf(subject))
  23. end
  24. return false
  25. end
  26. function canSee2(subject,viewer)
  27. if (not subject) or (not viewer) then return false end
  28. local sh = subject:findFirstChild("Death")
  29. local vh = viewer:findFirstChild("Head")
  30. if (not sh) or (not vh) then return false end
  31. local vec = sh.Position - vh.Position
  32. if (vec.magnitude < seen_dist) then
  33. local ray = Ray.new(vh.Position,vec.unit*200)
  34. local por = fpor(workspace,ray,viewer,false)
  35. return (por == nil) or (por:IsDescendantOf(subject))
  36. end
  37. return false
  38. end
  39. local GhX = 12
  40.  
  41. function stick(x, y)
  42. weld = Instance.new("Weld")
  43. weld.Part0 = x
  44. weld.Part1 = y
  45. local HitPos = x.Position
  46. local CJ = CFrame.new(HitPos)
  47. local C0 = x.CFrame:inverse() *CJ
  48. local C1 = y.CFrame:inverse() * CJ
  49. weld.C0 = C0
  50. weld.C1 = C1
  51. weld.Parent = x
  52. x.Anchored = false
  53. y.Anchored = false
  54. end
  55. stick(script.Parent, script.Parent.Face)
  56.  
  57.  
  58. while true do
  59. wait(0.1)
  60. local minmag = nil
  61. local minply = nil
  62. local mindir = nil
  63. local beingwatched = false
  64. players = game:GetService("Players"):GetChildren()
  65. for i=1,#players do
  66. char = players[i].Character
  67. if char then
  68. local foundhead = char:FindFirstChild("Head")
  69. local foundtorso = char:FindFirstChild("Torso")
  70. local foundHumanoidRootPart = char:FindFirstChild("HumanoidRootPart")
  71. local foundhum = char:FindFirstChild("Humanoid")
  72. if foundhead and foundtorso and foundHumanoidRootPart and foundhum and foundhum.Health > 0 then
  73. local sub = (script.Parent.CFrame.p - foundhead.CFrame.p)
  74. local dir = sub.unit
  75. local mag = sub.magnitude
  76. if not minmag or minmag > mag then
  77. minmag = mag
  78. minply = char:FindFirstChild("HumanoidRootPart")
  79. mindir = dir
  80. if canSee(script.Parent.Parent, char) then beingwatched = true end
  81. end
  82. end
  83. end
  84. end
  85.  
  86. if minply then
  87. local player=game.Players:GetPlayerFromCharacter(minply.Parent)
  88. if minply and not beingwatched and canSee2(script.Parent.Parent, minply.Parent) then
  89. if minmag and minmag <= 200 then
  90. local unit = (script.Parent.Position-minply.Position).unit
  91. unit = Vector3.new(unit.X,0,unit.Z)
  92. if minmag < 10 and minply.Parent:FindFirstChild("Humanoid") and minply.Parent.Humanoid.Health > 0 and not beingwatched then
  93. script.Parent.CFrame = CFrame.new(minply.Position.X, script.Parent.Position.Y, minply.Position.Z)
  94. minply.Parent:BreakJoints()
  95. print("173: Nice neck")
  96. script.Parent.Kill:Play()
  97. script.Parent.Blood.Value.Value=1
  98. local blood = Instance.new("Part")
  99. local blooddec = Instance.new("Decal")
  100. blood.FormFactor = "Custom"
  101. blood.Size = Vector3.new(6.59, 0.2, 7.03)
  102. blood.Position = Vector3.new(script.Parent.Position.X,script.Parent.Position.Y-3.969,script.Parent.Position.Z)
  103. blood.CanCollide = false
  104. blood.Anchored = true
  105. blood.Parent=workspace
  106. blood.Transparency = 1
  107. blooddec.Texture = "http://www.roblox.com/asset/?id=176678030"
  108. blooddec.Parent = blood
  109. blooddec.Face = "Top"
  110. game:GetService("Debris"):AddItem(blood,30)
  111. else
  112. script.Parent.CFrame = CFrame.new(script.Parent.Position + (unit*-15), Vector3.new(minply.Position.X, script.Parent.Position.Y, minply.Position.Z))
  113. script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(0,math.rad(180),0)
  114. script.Parent.Slide:Play()
  115. wait(0.000001)
  116. end
  117. end
  118.  
  119.  
  120. end
  121.  
  122.  
  123. end
  124. wait(.000001)
  125. script.Parent.Slide:Pause()
  126. wait(.000001)
  127. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement