Advertisement
iop23199

Roblox GunGane Aimbot

Dec 5th, 2019
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.88 KB | None | 0 0
  1. wait(1/60)
  2. Aimbotsettings={["bring"]=false,["lerp"]=false}
  3.  
  4. --Setting AimbotAll true
  5.  
  6. game:GetService("UserInputService").InputBegan:Connect(function(input)
  7.         if input.KeyCode==Enum.KeyCode.B then
  8.             if Aimbotsettings["bring"]==false then
  9.                 Aimbotsettings["bring"]=true
  10.             else
  11.                 Aimbotsettings["bring"]=false
  12.             end
  13.         end
  14.         if input.KeyCode==Enum.KeyCode.L then
  15.                     if Aimbotsettings["lerp"]==false then
  16.                 Aimbotsettings["lerp"]=true
  17.             else
  18.                 Aimbotsettings["lerp"]=false
  19.             end
  20.         end
  21.  
  22.  
  23. end)
  24.  
  25.  
  26. function findNearestTorso(pos, maxDistance, randomSelect)
  27.  local list = game.Workspace:GetChildren()
  28.  local torsos = {}
  29.  for x=1, #list do
  30.  if (list[x].className == "Model") and (list[x] ~= game.Players.LocalPlayer.Character) then
  31.  local torso = list[x]:findFirstChild("Head")
  32.  local human = list[x]:findFirstChild("Humanoid")
  33.  if torso ~= nil and human ~= nil and human.ClassName == "Humanoid" and human.Health > 0 then
  34.  for i=1,#torsos do
  35.  if (torso.Position - pos).magnitude < torsos[i][2] then
  36.  table.insert(torsos, i, {torso, (torso.Position - pos).magnitude})
  37.  break
  38.  end
  39.  if i == #torsos and (maxDistance == nil or (torso.Position - pos).magnitude < maxDistance) then
  40.  table.insert(torsos, {torso, (torso.Position - pos).magnitude})
  41.  end
  42.  end
  43.  if torsos[1] == nil and (maxDistance == nil or (torso.Position - pos).magnitude < maxDistance) then
  44.  torsos[1] = {torso, (torso.Position - pos).magnitude}
  45.  end
  46.  end
  47.  end
  48.  end
  49.  if randomSelect == nil then
  50.  return torsos[1][1], torsos[1][2]
  51.  else
  52.  if randomSelect > #torsos then randomSelect = #torsos end
  53.  local selection = math.random(1, randomSelect)
  54.  return torsos[selection][1], torsos[selection][2]
  55.  end
  56. end
  57.  
  58.  
  59. local ibelerpin=nil
  60. game:GetService("UserInputService").InputBegan:Connect(function(input)
  61.     if input.KeyCode==Enum.KeyCode.LeftAlt then
  62.        
  63.         if aimbot==true then
  64.             aimbot=false
  65.         else
  66.             aimbot=true
  67.            
  68.                
  69.            
  70.             spawn(function()
  71.                 if Aimbotsettings["bring"]==false then
  72.                      
  73.                local ev= game:GetService("RunService").RenderStepped:Connect(function()
  74.                    
  75.                   if aimbot==true then
  76.                       if Aimbotsettings["lerp"]==true then
  77.                           if ibelerpin~=findNearestTorso(game.Players.LocalPlayer.Character.Head.Position,math.huge) then
  78.                           for i=0,1,0.1 do
  79.                            if ibelerpin~=findNearestTorso(game.Players.LocalPlayer.Character.Head.Position,math.huge) then
  80.  
  81.                               wait()
  82.                                 workspace.CurrentCamera.CFrame= workspace.CurrentCamera.CFrame:Lerp(CFrame.new(workspace.CurrentCamera.CFrame.p,findNearestTorso(game.Players.LocalPlayer.Character.Head.Position,math.huge)),i)
  83.                                   else                                            ibelerpin=findNearestTorso(game.Players.LocalPlayer.Character.Head.Position,math.huge)
  84.                                                       ibelerpin=findNearestTorso(game.Players.LocalPlayer.Character.Head.Position,math.huge)
  85.  
  86.                                   break
  87.                            end
  88.                           end
  89.                                                       ibelerpin=findNearestTorso(game.Players.LocalPlayer.Character.Head.Position,math.huge)
  90.  
  91.                       end
  92.                         end
  93.                                 workspace.CurrentCamera.CFrame=CFrame.new(workspace.CurrentCamera.CFrame.p,findNearestTorso(game.Players.LocalPlayer.Character.Head.Position,math.huge).Position)
  94.                       end
  95.  
  96.  
  97.     end)
  98.    
  99.              
  100.                 else
  101.  
  102.  
  103.                               local ev= game:GetService("RunService").RenderStepped:Connect(function()
  104.                               if Aimbotsettings["bring"]==true then
  105.                                     game.Players.LocalPlayer.Character:SetPrimaryPartCFrame(findNearestTorso(game.Players.LocalPlayer.Character.Head.Position,math.huge).CFrame+Vector3.new(0,0,5))
  106.  
  107.                  
  108.                                 workspace.CurrentCamera.CFrame=CFrame.new(workspace.CurrentCamera.CFrame.p,findNearestTorso(game.Players.LocalPlayer.Character.Head.Position,math.huge).Position)
  109.                               end
  110.                
  111.                 end)
  112.                 end
  113.            
  114.             end)
  115.         end
  116.         end
  117.        
  118. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement