YANIS_EXPLOITS

Sound Spaceeee

Aug 8th, 2020
2,047
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. --[[ Made By Yanis#5565
  2.  
  3. ]]
  4. local cc = game:GetService("Workspace").CurrentCamera
  5. function getSquare()
  6. local last = math.huge
  7. local nearest = nil
  8. for i,v in pairs(game.workspace:GetDescendants()) do
  9. if v:IsA("Part") and v:FindFirstChildWhichIsA("SelectionBox") then
  10. local distance = (game:GetService("Workspace").Client.CameraPos.Position - v.Position).magnitude
  11. if distance < last then
  12. last = distance
  13. nearest = v
  14. end
  15. end
  16. end
  17. if nearest ~= nil then
  18. return nearest
  19. end
  20. end
  21. game:GetService('RunService').Stepped:connect(function()
  22. if game:GetService("Workspace").Client:FindFirstChild("Background") then
  23. local lol = getSquare()
  24. local bet1 = -0.4
  25. local bet2 = 1.1
  26. lol.CFrame = CFrame.new(lol.CFrame.x + math.random(bet1,bet2), lol.CFrame.y + math.random(bet1,bet2), lol.CFrame.z + math.random(bet1,bet2))
  27. cc.CFrame = CFrame.new(cc.CFrame.p, lol.CFrame.p)
  28. end
  29. end)
Add Comment
Please, Sign In to add comment