iiAdqm

assassin aimbot

Sep 30th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.70 KB | None | 0 0
  1. players = game.Players
  2. localPlayer = players.LocalPlayer
  3. bodyPosition = nil
  4. bodyGyro = nil
  5. currentTarget = nil
  6.  
  7. function getCFrameBehindPlayer(targetPlayer)
  8. if targetPlayer.Character ~= nil then
  9. local targetTorso = targetPlayer.Character:FindFirstChild("HumanoidRootPart")
  10. if targetTorso ~= nil then
  11. local torsoRotation = targetTorso.CFrame:toAxisAngle()
  12. local bottomOfTorso = targetTorso.CFrame.p-Vector3.new(0,targetTorso.Size.Y/2,0)
  13. local behindTorso = CFrame.new(bottomOfTorso-targetTorso.CFrame.lookVector*1.2)+Vector3.new(0,1,0)
  14. return behindTorso*CFrame.Angles(torsoRotation.X,torsoRotation.Y,torsoRotation.Z)
  15. else
  16. currentTarget = nil
  17. end
  18. else
  19. currentTarget = nil
  20. end
  21. end
  22.  
  23. function teleportBehindPlayer(playerToTeleport,targetPlayer)
  24. if playerToTeleport.Character ~= nil and targetPlayer.Character ~= nil then
  25. local playerTorso = playerToTeleport.Character:FindFirstChild("HumanoidRootPart")
  26. local targetTorso = targetPlayer.Character:FindFirstChild("HumanoidRootPart")
  27. if playerTorso ~= nil and targetTorso ~= nil then
  28. local behindPlayer = getCFrameBehindPlayer(targetPlayer)
  29. playerTorso.CFrame = behindPlayer
  30. if typeof(bodyPosition) == "Instance" and bodyPosition:IsA("BodyPosition") then
  31. bodyPosition.Position = behindPlayer.p
  32. bodyPosition.MaxForce = Vector3.new(5e9,5e9,5e9)
  33. end
  34. if typeof(bodyGyro) == "Instance" and bodyGyro:IsA("BodyGyro") then
  35. bodyGyro.CFrame = behindPlayer
  36. bodyGyro.MaxTorque = Vector3.new(5e9,5e9,5e9)
  37. end
  38. else
  39. currentTarget = nil
  40. end
  41. else
  42. currentTarget = nil
  43. end
  44. end
  45.  
  46. game.ReplicatedStorage.Remotes.UpdateTarget.OnClientEvent:connect(function(targetName)
  47. local targetPlayer = players:FindFirstChild(targetName)
  48. if targetPlayer ~= nil and targetPlayer:IsA("Player") and targetPlayer ~= localPlayer then
  49. wait(1)
  50. currentTarget = targetPlayer
  51. teleportBehindPlayer(localPlayer,targetPlayer)
  52. if currentTarget ~= nil and currentTarget.Character ~= nil and currentTarget.Character:FindFirstChildOfClass("Humanoid") then
  53. currentTarget.Character:FindFirstChildOfClass("Humanoid").Died:connect(function()
  54. if typeof(bodyPosition) == "Instance" and bodyPosition:IsA("BodyPosition") then
  55. bodyPosition.MaxForce = Vector3.new(0,0,0)
  56. end
  57. if typeof(bodyGyro) == "Instance" and bodyGyro:IsA("BodyGyro") then
  58. bodyGyro.MaxTorque = Vector3.new(0,0,0)
  59. end
  60. end)
  61. else
  62. currentTarget = nil
  63. end
  64. else
  65. currentTarget = nil
  66. end
  67. end)
  68.  
  69. function setupCharacter(char)
  70. bodyPosition = Instance.new("BodyPosition")
  71. bodyPosition.D = 100
  72. bodyPosition.MaxForce = Vector3.new(0,0,0)
  73. bodyPosition.P = 8000
  74. bodyGyro = Instance.new("BodyGyro")
  75. bodyGyro.D = 100
  76. bodyGyro.MaxTorque = Vector3.new(0,0,0)
  77. bodyGyro.P = 8000
  78. bodyPosition.Parent = char:WaitForChild("HumanoidRootPart")
  79. bodyGyro.Parent = char.HumanoidRootPart
  80. char:WaitForChild("Humanoid").Died:connect(function()
  81. currentTarget = nil
  82. if typeof(bodyPosition) == "Instance" and bodyPosition:IsA("BodyPosition") then
  83. bodyPosition.MaxForce = Vector3.new(0,0,0)
  84. end
  85. if typeof(bodyGyro) == "Instance" and bodyGyro:IsA("BodyGyro") then
  86. bodyGyro.MaxTorque = Vector3.new(0,0,0)
  87. end
  88. end)
  89. end
  90.  
  91. if localPlayer.Character ~= nil then
  92. setupCharacter(localPlayer.Character)
  93. end
  94.  
  95. localPlayer.CharacterAdded:connect(function(char)
  96. setupCharacter(char)
  97. end)
  98.  
  99. game:GetService("RunService").RenderStepped:connect(function()
  100. if currentTarget ~= nil and currentTarget:IsA("Player") and currentTarget.Character ~= nil then
  101. local behindPlayer = getCFrameBehindPlayer(currentTarget)
  102. if behindPlayer ~= nil and typeof(bodyPosition) == "Instance" and bodyPosition:IsA("BodyPosition") then
  103. bodyPosition.Position = behindPlayer.p
  104. bodyPosition.MaxForce = Vector3.new(5e9,5e9,5e9)
  105. end
  106. if typeof(bodyGyro) == "Instance" and bodyGyro:IsA("BodyGyro") then
  107. local targetTorso = currentTarget.Character:FindFirstChild("HumanoidRootPart")
  108. if targetTorso ~= nil then
  109. bodyGyro.CFrame = targetTorso.CFrame
  110. bodyGyro.MaxTorque = Vector3.new(5e9,5e9,5e9)
  111. end
  112. end
  113. else
  114. currentTarget = nil
  115. end
  116. end)
Add Comment
Please, Sign In to add comment