Advertisement
Guest User

RB World 2 Aimbot

a guest
Jun 25th, 2018
5,368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1. --[[
  2. Written by A1_exe
  3. Edited by Shrektella
  4. F to Use the Aimbot
  5. Q to toggle between 100/99 accuracy
  6. ]]
  7.  
  8. local player = game:GetService('Players').LocalPlayer
  9. local mouse = player:GetMouse()
  10. local range_min, range_max = 99, 99;
  11. local ScreenGui = Instance.new("ScreenGui",player.PlayerGui)
  12. local Frame = Instance.new("Frame",ScreenGui)
  13. Frame.Size = UDim2.new(0,44,0,44)
  14. Frame.Position = UDim2.new(0.005,0,0.923, 0)
  15. Frame.BackgroundColor3 = Color3.new(255, 255, 127/255)
  16. Frame.Active = true
  17. Frame.Draggable = true
  18. local TextLabel = Instance.new("TextLabel",Frame)
  19. TextLabel.Size = UDim2.new(0,32,0,34)
  20. TextLabel.Position = UDim2.new(0.136,0,0.114, 0)
  21. TextLabel.BackgroundTransparency = 1
  22. TextLabel.Text = range_min
  23. TextLabel.TextScaled = true
  24. TextLabel.Font = "SciFi"
  25. TextLabel.Active = false
  26.  
  27.  
  28.  
  29.  
  30. mouse.KeyDown:connect(function(key)
  31. if key == "q" then
  32. if range_min == 99 and range_max == 99 then
  33. TextLabel.Text = "100"
  34. Frame.BackgroundColor3 = Color3.new(85/255, 255, 127/255)
  35. range_min = 100
  36. range_max = 100
  37. else if range_min == 100 and range_max == 100 then
  38. TextLabel.Text = "99"
  39. Frame.BackgroundColor3 = Color3.new(255, 255, 127/255)
  40. range_min = 99
  41. range_max = 99
  42. end
  43. end
  44. end
  45. end)
  46.  
  47. local playerData = player:FindFirstChild('System')
  48. local onTeam = playerData and playerData:FindFirstChild('OnTeam')
  49.  
  50. local storage = game:GetService('ReplicatedStorage')
  51. local gp = storage.gameplay
  52. local char = gp.character
  53. local val = char.value
  54.  
  55. local function find(t,i)
  56. for index, val in next, (t) do
  57. if (index == i) then
  58. return true, index, val
  59. elseif (val == i) then
  60. return true, index, val
  61. end
  62. end
  63. end
  64.  
  65. local hoops = (function()
  66. local hs = {},{};
  67.  
  68. local rec do
  69. rec = function(o)
  70. for __, child in next, (o:GetChildren()) do
  71. if string.lower(child['Name']):match('hoop') and child:FindFirstChild('Goal') then
  72. table.insert(hs, child)
  73. elseif #child:GetChildren() > 0 then
  74. rec(child)
  75. end
  76. end
  77. end
  78. end
  79.  
  80. rec(game.Workspace)
  81.  
  82. return hs
  83. end)()
  84.  
  85. local getShoot = function()
  86. local c = player.Character or player.CharacterAdded:wait()
  87. local hrp = c:WaitForChild('HumanoidRootPart',5)
  88. if not hrp then print('No humanoid root part.') return end
  89.  
  90.  
  91. local ball;
  92. for __, obj in next, (workspace:GetChildren()) do
  93. if obj.Name:lower() == 'basketball' and obj.controller.Value == player.Name then
  94. return obj.shoot
  95. end
  96. end
  97. end
  98.  
  99. local getHoop = function()
  100. local c = player.Character or player.CharacterAdded:wait()
  101. local hrp = c:WaitForChild('HumanoidRootPart',5)
  102. if not hrp then print('No humanoid root part.') return end
  103.  
  104. local last, closest = math.huge;
  105. for __, hoop in next, (hoops) do
  106. local goal = hoop:FindFirstChild('Goal')
  107.  
  108. if goal then
  109. local dist = (hrp.Position-goal.Position).magnitude
  110. if dist < last then
  111. last = dist
  112. closest = hoop
  113. end
  114. end
  115. end
  116. return closest
  117. end
  118.  
  119. local Attack = function(shoot, hoop)
  120. if shoot and hoop then
  121. val:FireServer("shooting", true)
  122. shoot:FireServer(hoop, math.random(range_min,range_max), true)
  123. end
  124. end
  125.  
  126. mouse.KeyDown:connect(function(key)
  127. if key == "f" then
  128. local shoot = getShoot()
  129. local hoop = getHoop()
  130.  
  131. court = hoop.Parent
  132. local data = court:FindFirstChild('GameData')
  133. local teamball = data and data:FindFirstChild('TeamBall')
  134.  
  135. local h1 = court:FindFirstChild('_Hoop1')
  136. local h2 = court:FindFirstChild('_Hoop2')
  137.  
  138. if OnTeam and OnTeam.Value == 1 and h1 then
  139. Attack(shoot,h1)
  140. return
  141. elseif OnTeam and OnTeam.Value == 2 and h2 then
  142. Attack(shoot,h2)
  143. return
  144. end
  145.  
  146. if teamball and teamball.Value == 1 and h1 then
  147. Attack(shoot,h1)
  148. return
  149. elseif teamball and teamball.Value == 2 and h2 then
  150. Attack(shoot,h2)
  151. return
  152. end
  153.  
  154.  
  155. Attack(shoot,hoop)
  156. end
  157. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement