Advertisement
Guest User

following script of bloxiphant bot by professeur3

a guest
Jan 26th, 2020
504
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1.  
  2. --Credits Professeur3
  3.  
  4. local larm = script.Parent:FindFirstChild("HumanoidRootPart")
  5. local rarm = script.Parent:FindFirstChild("HumanoidRootPart")
  6.  
  7. function findNearestTorso(pos)
  8. local list = game.Workspace:children()
  9. local torso = nil
  10. local dist = 10000
  11. local temp = nil
  12. local human = nil
  13. local temp2 = nil
  14. for x = 1, #list do
  15. temp2 = list[x]
  16. if (temp2.className == "Model") and (temp2 ~= script.Parent) then
  17. temp = temp2:findFirstChild("HumanoidRootPart")
  18. human = temp2:findFirstChild("Humanoid")
  19. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  20. if (temp.Position - pos).magnitude < dist then
  21. torso = temp
  22. dist = (temp.Position - pos).magnitude
  23. end
  24. end
  25. end
  26. end
  27. return torso
  28. end
  29.  
  30.  
  31.  
  32.  
  33. while true do
  34. wait(math.random(1,5))
  35. local target = findNearestTorso(script.Parent.HumanoidRootPart.Position)
  36. if target ~= nil then
  37. script.Parent.Humanoid:MoveTo(target.Position, target)
  38. end
  39.  
  40. end
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement