Advertisement
CriShoux

box light saber real

Sep 24th, 2019
4,000
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. local aimbotting = false
  2. local tweenService = game:GetService("TweenService")
  3. local currentCamera = game:GetService("Workspace").CurrentCamera
  4. local localPlayer = game:GetService("Players").LocalPlayer
  5. local client = game:GetService("Workspace").Client
  6.  
  7. local function getClosestCube()
  8. local closestCube = nil
  9. local shortestDistance = math.huge
  10.  
  11. for i, v in pairs(client.Cubes:GetChildren()) do
  12. if v:IsA("BasePart") then
  13. local magnitude = (v.Position - client.CameraPos.Position).magnitude
  14.  
  15. if magnitude < shortestDistance then
  16. closestCube = v
  17. shortestDistance = magnitude
  18. end
  19. end
  20. end
  21.  
  22. return closestCube
  23. end
  24.  
  25. game:GetService("UserInputService").InputBegan:Connect(function(input, onGui)
  26. if not onGui and input.KeyCode == Enum.KeyCode.T then
  27. aimbotting = not aimbotting
  28. warn("Aiming : " .. tostring(aimbotting))
  29. end
  30. end)
  31.  
  32. game:GetService("RunService").RenderStepped:Connect(function()
  33. if aimbotting then
  34. pcall(function()
  35. tweenService:Create(currentCamera, TweenInfo.new(0.065, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CFrame = CFrame.new(client.CameraPos.Position, getClosestCube().Position)}):Play()
  36. end)
  37. end
  38. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement