Advertisement
Guest User

RB WORLD 2 Aimbot 2

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