Donor2222

Aimbot1

Dec 28th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Mouse = Player:GetMouse()
  3. local CurrentCamera = game.Workspace.CurrentCamera
  4. local Trigger = 120
  5. local Enabled = false
  6. local EspBoxes = {}
  7.  
  8. function GetNearestPlayerToMouse()
  9. local players = {}
  10. local plrhld = {}
  11. local dists = {}
  12. for i, v in pairs(game.Players:GetPlayers()) do
  13. if v~=Player then
  14. table.insert(players,v)
  15. end
  16. end
  17. for i, v in pairs(players) do
  18. if v and (v.Character)~=nil then
  19. local head = v.Character:FindFirstChild("Head")
  20. if head~=nil then
  21. local dist = (head.Position-game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude
  22. plrhld[v.Name..i]={}
  23. plrhld[v.Name..i].dist=dist
  24. plrhld[v.Name..i].plr=v
  25. local ray = Ray.new(game.Workspace.CurrentCamera.CoordinateFrame.p,(Mouse.Hit.p-game.Workspace.CurrentCamera.CoordinateFrame.p).unit*dist)
  26. local hit,pos = game.Workspace:FindPartOnRay(ray,game.Workspace)
  27. local diff = math.floor((pos-head.Position).magnitude)
  28. plrhld[v.Name..i].diff=diff
  29. table.insert(dists,diff)
  30. end
  31. end
  32. end
  33. if unpack(dists) == nil then
  34. return false
  35. end
  36. local ldist = math.floor(math.min(unpack(dists)))
  37. if ldist > 20 then
  38. return false
  39. end
  40. for i, v in pairs(plrhld) do
  41. if v.diff==ldist then
  42. return v.plr
  43. end
  44. end
  45. return false
  46. end
  47.  
  48. Mouse.KeyDown:connect(
  49. function(key)
  50. key = key:lower():byte()
  51. if key == Trigger then
  52. Enabled = true
  53. end
  54. end
  55. )
  56.  
  57. Mouse.KeyUp:connect(
  58. function(key)
  59. key = key:lower():byte()
  60. if key == Trigger then
  61. Enabled = false
  62. end
  63. end
  64. )
  65.  
  66. local g = Instance.new("ScreenGui")
  67. g.Name="RiasAimbot"
  68. g.Parent=game.CoreGui
  69. local tl = Instance.new("TextLabel")
  70. tl.Size = UDim2.new(0,200,0,40)
  71. tl.BackgroundTransparency=0.3
  72. tl.BackgroundColor3=Color3.new(1,1,1)
  73. tl.Position=UDim2.new(0.5,-100,0,0)
  74. tl.Text = "Aimbot off"
  75. tl.TextStrokeColor3= Color3.new(27/255, 42/255, 53/255)
  76. tl.TextColor3=Color3.new(1,1,1)
  77. tl.TextStrokeTransparency=0
  78. tl.Parent=g
  79. tl.TextWrapped=true
  80. tl.FontSize="Size32"
  81. tl.Font="SourceSansBold"
  82.  
  83.  
  84. game:GetService("RunService").RenderStepped:connect(
  85. function()
  86. if Enabled then
  87. local Target = GetNearestPlayerToMouse()
  88. if (Target~=false) then
  89. local head = Target.Character:FindFirstChild("Head")
  90. if head then
  91. game.Workspace.CurrentCamera.CoordinateFrame = CFrame.new(game.Workspace.CurrentCamera.CoordinateFrame.p,head.CFrame.p)
  92. end
  93. tl.Text = "Aim: "..Target.NameConfusedub(1,5)
  94. else
  95. tl.Text = "Aimbot off"
  96. end
  97. end
  98. for i, v in pairs(game.Players:GetPlayers()) do
  99. if type(EspBoxes[v.Name:lower()])=="table" then
  100. local tabl = EspBoxes[v.Name:lower()]
  101. if (tabl.gui)~= nil then
  102. tabl.gui.Adornee = v.Character:FindFirstChild("Torso") or nil
  103. else
  104. EspBoxes[v.Name:lower()] = nil
  105. end
  106. else
  107. EspBoxes[v.Name:lower()]={}
  108. local tabl = EspBoxes[v.Name:lower()]
  109. tabl.gui = Instance.new("BillboardGui")
  110. tabl.gui.Name="esprekt"
  111. tabl.gui.Parent=game.Workspace.CurrentCamera
  112. tabl.gui.Adornee=v.Character:FindFirstChild("Torso") and v.Character.Torso or nil
  113. tabl.gui.esp = Instance.new("ImageLabel",tabl.gui)
  114. tabl.gui.AlwaysOnTop=true
  115. tabl.gui.Size=UDim2.new(2,40,2,40)
  116. tabl.StudsOffset=Vector3.new(0,0,0)
  117. local esp = tabl.gui.esp
  118. esp.BackgroundTransparency=1
  119. esp.Size=UDim2.new(1,0,1,0)
  120. esp.ImageColor3=Color3.new(1,1,1)
  121. esp.Image="http://www.roblox.com/asset/?id=103834483"
  122. end
  123. end
  124. end)
Add Comment
Please, Sign In to add comment