Macrosaw

rb world 2 aimbot

Nov 18th, 2018
923
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.31 KB | None | 0 0
  1. --[[
  2. Hold e and press q
  3. or just press q
  4. Written by A1_exe
  5. not made by me
  6. ]]
  7.  
  8. local player = game:GetService('Players').LocalPlayer
  9. local mouse = player:GetMouse()
  10.  
  11. local range_min, range_max = 95, 100;
  12.  
  13. local playerData = player:FindFirstChild('System')
  14. local onTeam = playerData and playerData:FindFirstChild('OnTeam')
  15.  
  16. local storage = game:GetService('ReplicatedStorage')
  17. local gp = storage.gameplay
  18. local char = gp.character
  19. local val = char.value
  20.  
  21. local function find(t,i)
  22.   for index, val in next, (t) do
  23.       if (index == i) then
  24.           return true, index, val
  25.       elseif (val == i) then
  26.           return true, index, val
  27.       end
  28.   end
  29. end
  30.  
  31. local hoops = (function()
  32.   local hs = {},{};
  33.  
  34.   local rec do
  35.       rec = function(o)
  36.           for __, child in next, (o:GetChildren()) do
  37.               if string.lower(child['Name']):match('hoop') and child:FindFirstChild('Goal') then
  38.                   table.insert(hs, child)
  39.               elseif #child:GetChildren() > 0 then
  40.                   rec(child)
  41.               end
  42.           end
  43.       end
  44.   end
  45.  
  46.   rec(game.Workspace)
  47.    
  48.   return hs
  49. end)()
  50.  
  51. local getShoot = function()
  52.   local c = player.Character or player.CharacterAdded:wait()
  53.   local hrp = c:WaitForChild('HumanoidRootPart',5)
  54.   if not hrp then print('No humanoid root part.')  return end
  55.      
  56.  
  57.   local ball;
  58.   for __, obj in next, (workspace:GetChildren()) do
  59.       if obj.Name:lower() == 'basketball'  and obj.controller.Value == player.Name then
  60.           return obj.shoot
  61.       end
  62.   end
  63. end
  64.  
  65. local getHoop = function()
  66.   local c = player.Character or player.CharacterAdded:wait()
  67.   local hrp = c:WaitForChild('HumanoidRootPart',5)
  68.   if not hrp then print('No humanoid root part.') return end
  69.      
  70.   local last, closest = math.huge;
  71.   for __, hoop in next, (hoops) do
  72.       local goal = hoop:FindFirstChild('Goal')
  73.      
  74.       if goal then
  75.           local dist = (hrp.Position-goal.Position).magnitude
  76.           if dist < last then
  77.               last = dist
  78.               closest = hoop
  79.           end
  80.       end
  81.   end
  82.   return closest
  83. end
  84.  
  85. local Attack = function(shoot, hoop)
  86.   if shoot and hoop then
  87.      val:FireServer("shooting", true)
  88.      shoot:FireServer(hoop, math.random(range_min,range_max), true)
  89.   end
  90. end
  91.  
  92. mouse.KeyDown:connect(function(key)
  93.   if key == "q" then
  94.       local shoot = getShoot()
  95.       local hoop = getHoop()
  96.      
  97.       court = hoop.Parent
  98.       local data = court:FindFirstChild('GameData')
  99.       local teamball = data and data:FindFirstChild('TeamBall')
  100.  
  101.       local h1 = court:FindFirstChild('_Hoop1')
  102.       local h2 = court:FindFirstChild('_Hoop2')
  103.      
  104.       if OnTeam and OnTeam.Value == 1 and h1 then
  105.           Attack(shoot,h1)
  106.           return
  107.       elseif OnTeam and OnTeam.Value == 2  and h2 then
  108.           Attack(shoot,h2)
  109.           return
  110.       end
  111.      
  112.       if teamball and teamball.Value == 1 and h1 then
  113.           Attack(shoot,h1)
  114.           return
  115.       elseif teamball and teamball.Value == 2  and h2 then
  116.           Attack(shoot,h2)
  117.           return
  118.       end
  119.      
  120.  
  121.      Attack(shoot,hoop)
  122.   end
  123. end)
  124.  
  125. -- This is detectable so comment it out now.
  126. --warn('Morse: ... -.-. .-. .. .--. - . .-. | -..-. -..-. | .--. .-. --- --. .-. .- -- -- . .-.')
  127. --warn('Located',#hoops,'hoops.')
Advertisement
Add Comment
Please, Sign In to add comment