lukbooo

roblox follow avatar script leak

Feb 2nd, 2022 (edited)
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. SCRIPT BY LUKBOO ON YT!! enjoy :D (copy line 2-28)
  2. function findTorso(pos)
  3. local torso = nil
  4. local dist = 100000
  5. local child = workspace:children()
  6. for i=1, #child do
  7. if child[i].className == "Model" then
  8. local h = child[i]:findFirstChild("Humanoid")
  9. if h ~= nil then
  10. local check = child[i]:findFirstChild("Head")
  11. if check ~= nil then
  12. if (check.Position - pos).magnitude < dist then
  13. torso = check
  14. dist = (check.Position - pos).magnitude
  15. end
  16. end
  17. end
  18. end
  19. end
  20. return torso
  21. end
  22.  
  23. game:GetService("RunService").Stepped:Connect(function()
  24. local torso = findTorso(script.Parent.Position)
  25. if torso ~= nil then
  26. script.Parent.CFrame = CFrame.new(script.Parent.Position, torso.Position)
  27. end
  28. end)
Add Comment
Please, Sign In to add comment