Advertisement
Guest User

mod

a guest
Jun 17th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. --> Made by Stefan#6965
  2.  
  3. local lp = game:GetService("Players").LocalPlayer
  4. local cam = game:GetService("Workspace").CurrentCamera
  5. local CameraPart = game:GetService("Workspace"):WaitForChild("Client"):WaitForChild("CameraPos")
  6. local CurrentObject = nil
  7. local folder = game:GetService("Workspace"):WaitForChild("Client"):WaitForChild("Cubes")
  8. local ms = lp:GetMouse()
  9. local function Find(arr)
  10. local POS = CameraPart.Position
  11. local bestpos = 100000000000000
  12. local bestpart = nil
  13. for i,v in pairs(arr) do
  14. if v.Name == "Cube" and v:IsA("Part") and (POS - v.Position).magnitude < bestpos then
  15. bestpos = (POS - v.Position).magnitude
  16. bestpart = v
  17. end
  18. end
  19. return bestpart
  20. end
  21. spawn(function()
  22. while true do
  23. local cubes = folder:GetChildren()
  24. local BestPart = Find(cubes)
  25. CurrentObject = BestPart
  26. wait()
  27. end
  28. end)
  29. repeat wait() until CurrentObject ~= nil
  30. while true do
  31. cam.CFrame = CFrame.new(CameraPart.Position,CurrentObject.Position)
  32. wait()
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement