Advertisement
Guest User

Untitled

a guest
Oct 31st, 2019
2,964
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.70 KB | None | 0 0
  1. --[[
  2. Controls
  3.  
  4. Q (hold)- Gradually teleport forward
  5. G- Teleport forward 5 studs
  6. H- Teleport forward 10 studs
  7.  
  8. T (hold)- Teleport behind nearest valid player
  9. F (hold)- Lock mouse onto nearest player
  10.  
  11. 'Aimbot TK' will detmine whether the aimbot will
  12. ignore teamates (will attack teamates if true)
  13.  
  14. 'Aimbot uses reticle' will determine whether the
  15. aimbot will lock onto the nearest player to the
  16. mouse or closet to your actual character
  17.  
  18. 'Max teleport distance' will set the limit for
  19. the T keybind (useful for games with anticheats)
  20.  
  21.  
  22. Scripted by genericusername1231#7218
  23. ]]
  24.  
  25. player = game.Players.LocalPlayer
  26. mouse = player:GetMouse()
  27. uis = game:GetService("UserInputService")
  28. rs = game:GetService("RunService")
  29.  
  30. connections = {}
  31. aimbotactive = true
  32. clr = false
  33. currenttool = nil
  34. buttondown = false
  35.  
  36. aimbotTK = true
  37. snaptoreticle = true
  38. teleportenabled = true
  39. acceptableteleportdistance = 20
  40.  
  41. local s, e = pcall(function()
  42. if not player.PlayerGui:FindFirstChild("Aimbot") then
  43. gui = Instance.new("ScreenGui")
  44. local Frame = Instance.new("Frame")
  45. local ImageLabel = Instance.new("ImageLabel")
  46. local AimbotTKT = Instance.new("TextLabel")
  47. local AimbotTK = Instance.new("TextButton")
  48. local Reticle = Instance.new("TextButton")
  49. local ReticleT = Instance.new("TextLabel")
  50. local Teleport = Instance.new("TextButton")
  51. local TeleportT = Instance.new("TextLabel")
  52. local TeleportDist = Instance.new("TextBox")
  53. local TeleportDistT = Instance.new("TextLabel")
  54. local Error = Instance.new("TextLabel")
  55. local TextLabel = Instance.new("TextLabel")
  56. local Drag = Instance.new("TextButton")
  57.  
  58. gui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  59. gui.Name = "Aimbot"
  60. gui.ResetOnSpawn = false
  61. gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  62.  
  63. Frame.Parent = gui
  64. Frame.BackgroundColor3 = Color3.new(0, 0, 0)
  65. Frame.ClipsDescendants = true
  66. Frame.Draggable = true
  67. Frame.Position = UDim2.new(0.100000001, 0, 0.5, -179)
  68. Frame.Selectable = true
  69. Frame.Size = UDim2.new(0, 200, 0, 358)
  70. Frame.ZIndex = 2
  71.  
  72. ImageLabel.Parent = Frame
  73. ImageLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  74. ImageLabel.Draggable = true
  75. ImageLabel.Size = UDim2.new(1, 0, 1, 0)
  76. ImageLabel.Image = "http://www.roblox.com/asset/?id=4221488610"
  77.  
  78. AimbotTKT.Name = "AimbotTKT"
  79. AimbotTKT.Parent = Frame
  80. AimbotTKT.BackgroundColor3 = Color3.new(0, 0, 0)
  81. AimbotTKT.BackgroundTransparency = 0.40000000596046
  82. AimbotTKT.Position = UDim2.new(0.100000001, 0, 0.0700000003, 0)
  83. AimbotTKT.Size = UDim2.new(0.649999976, 0, 0.0500000007, 0)
  84. AimbotTKT.Font = Enum.Font.SourceSans
  85. AimbotTKT.Text = "Aimbot TK"
  86. AimbotTKT.TextColor3 = Color3.new(1, 1, 1)
  87. AimbotTKT.TextSize = 17
  88.  
  89. AimbotTK.Name = "AimbotTK"
  90. AimbotTK.Parent = Frame
  91. AimbotTK.BackgroundColor3 = Color3.new(0, 0, 0)
  92. AimbotTK.BackgroundTransparency = 0.40000000596046
  93. AimbotTK.Position = UDim2.new(0.850000024, 0, 0.0700000003, 0)
  94. AimbotTK.Size = UDim2.new(0.0700000003, 0, 0.0500000007, 0)
  95. AimbotTK.Font = Enum.Font.SourceSans
  96. AimbotTK.Text = ""
  97. AimbotTK.TextColor3 = Color3.new(1, 1, 1)
  98. AimbotTK.TextSize = 17
  99.  
  100. Reticle.Name = "Reticle"
  101. Reticle.Parent = Frame
  102. Reticle.BackgroundColor3 = Color3.new(0, 0, 0)
  103. Reticle.BackgroundTransparency = 0.40000000596046
  104. Reticle.Position = UDim2.new(0.850000024, 0, 0.140000001, 0)
  105. Reticle.Size = UDim2.new(0.0700000003, 0, 0.0500000007, 0)
  106. Reticle.Font = Enum.Font.SourceSans
  107. Reticle.Text = "X"
  108. Reticle.TextColor3 = Color3.new(1, 1, 1)
  109. Reticle.TextSize = 17
  110.  
  111. ReticleT.Name = "ReticleT"
  112. ReticleT.Parent = Frame
  113. ReticleT.BackgroundColor3 = Color3.new(0, 0, 0)
  114. ReticleT.BackgroundTransparency = 0.40000000596046
  115. ReticleT.Position = UDim2.new(0.100000001, 0, 0.140000001, 0)
  116. ReticleT.Size = UDim2.new(0.649999976, 0, 0.0500000007, 0)
  117. ReticleT.Font = Enum.Font.SourceSans
  118. ReticleT.Text = "Aimbot uses reticle"
  119. ReticleT.TextColor3 = Color3.new(1, 1, 1)
  120. ReticleT.TextSize = 17
  121.  
  122. Teleport.Name = "Teleport"
  123. Teleport.Parent = Frame
  124. Teleport.BackgroundColor3 = Color3.new(0, 0, 0)
  125. Teleport.BackgroundTransparency = 0.40000000596046
  126. Teleport.Position = UDim2.new(0.850000024, 0, 0.209999993, 0)
  127. Teleport.Size = UDim2.new(0.0700000003, 0, 0.0500000007, 0)
  128. Teleport.Font = Enum.Font.SourceSans
  129. Teleport.Text = "X"
  130. Teleport.TextColor3 = Color3.new(1, 1, 1)
  131. Teleport.TextSize = 17
  132.  
  133. TeleportT.Name = "TeleportT"
  134. TeleportT.Parent = Frame
  135. TeleportT.BackgroundColor3 = Color3.new(0, 0, 0)
  136. TeleportT.BackgroundTransparency = 0.40000000596046
  137. TeleportT.Position = UDim2.new(0.100000001, 0, 0.209999993, 0)
  138. TeleportT.Size = UDim2.new(0.649999976, 0, 0.0500000007, 0)
  139. TeleportT.Font = Enum.Font.SourceSans
  140. TeleportT.Text = "Enable teleport"
  141. TeleportT.TextColor3 = Color3.new(1, 1, 1)
  142. TeleportT.TextSize = 17
  143.  
  144. TeleportDist.Name = "TeleportDist"
  145. TeleportDist.Parent = Frame
  146. TeleportDist.BackgroundColor3 = Color3.new(0, 0, 0)
  147. TeleportDist.BackgroundTransparency = 0.40000000596046
  148. TeleportDist.Position = UDim2.new(0.850000024, 0, 0.279999993, 0)
  149. TeleportDist.Size = UDim2.new(0.100000003, 0, 0.0500000007, 0)
  150. TeleportDist.Font = Enum.Font.SourceSans
  151. TeleportDist.Text = tostring(acceptableteleportdistance)
  152. TeleportDist.TextColor3 = Color3.new(1, 1, 1)
  153. TeleportDist.TextSize = 17
  154.  
  155. TeleportDistT.Name = "TeleportDistT"
  156. TeleportDistT.Parent = Frame
  157. TeleportDistT.BackgroundColor3 = Color3.new(0, 0, 0)
  158. TeleportDistT.BackgroundTransparency = 0.40000000596046
  159. TeleportDistT.Position = UDim2.new(0.100000001, 0, 0.279999993, 0)
  160. TeleportDistT.Size = UDim2.new(0.649999976, 0, 0.0500000007, 0)
  161. TeleportDistT.Font = Enum.Font.SourceSans
  162. TeleportDistT.Text = "Max teleport distance"
  163. TeleportDistT.TextColor3 = Color3.new(1, 1, 1)
  164. TeleportDistT.TextSize = 17
  165.  
  166. Error.Name = "Error"
  167. Error.Parent = Frame
  168. Error.BackgroundColor3 = Color3.new(0, 0, 0)
  169. Error.BackgroundTransparency = 0.40000000596046
  170. Error.Position = UDim2.new(0.100000001, 0, 0.800000012, 0)
  171. Error.Size = UDim2.new(0.800000012, 0, 0.150000006, 0)
  172. Error.Font = Enum.Font.SourceSans
  173. Error.Text = ""
  174. Error.TextColor3 = Color3.new(0.745098, 0.207843, 0.160784)
  175. Error.TextSize = 17
  176. Error.TextWrapped = true
  177. Error.TextXAlignment = Enum.TextXAlignment.Left
  178. Error.TextYAlignment = Enum.TextYAlignment.Top
  179.  
  180. TextLabel.Parent = Frame
  181. TextLabel.BackgroundColor3 = Color3.new(0, 0, 0)
  182. TextLabel.BackgroundTransparency = 0.40000000596046
  183. TextLabel.Position = UDim2.new(0.100000001, 0, 0.649999976, 0)
  184. TextLabel.Size = UDim2.new(0.800000012, 0, 0.100000001, 0)
  185. TextLabel.Font = Enum.Font.SourceSans
  186. TextLabel.Text = "GUI and script by genericusername1231#7218."
  187. TextLabel.TextColor3 = Color3.new(1, 1, 1)
  188. TextLabel.TextSize = 15
  189. TextLabel.TextWrapped = true
  190.  
  191. Drag.Name = "Drag"
  192. Drag.Parent = Frame
  193. Drag.BackgroundColor3 = Color3.new(0, 0, 0)
  194. Drag.BackgroundTransparency = 0.5
  195. Drag.Size = UDim2.new(1, 0, 0.0500000007, 0)
  196. Drag.Font = Enum.Font.SourceSans
  197. Drag.Text = ""
  198. Drag.TextColor3 = Color3.new(0, 0, 0)
  199. Drag.TextSize = 14
  200. end
  201.  
  202. if s then
  203. print("GUI loaded")
  204. end
  205. end)
  206.  
  207. function displayerror(str)
  208. spawn(function() gui.Frame.Error.Text = str wait(2.5) gui.Frame.Error.Text = "" end)
  209. end
  210.  
  211.  
  212. function getnearestplayer()
  213. if player.Character then
  214. local lowest = math.huge
  215. local h = nil
  216. for i,v in pairs(game.Players:GetPlayers()) do
  217. if v and v ~= player and (v.TeamColor ~= player.TeamColor or aimbotTK) and v.Character and v.Character:FindFirstChild("Head") and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health > 0 and player.Character and player.Character:FindFirstChild("Head") then
  218. local distance = (player.Character.Head.Position - v.Character.Head.Position).magnitude
  219. if distance < lowest then
  220. lowest = distance
  221. h = v
  222. end
  223. end
  224. end
  225. return h
  226. end
  227. end
  228.  
  229. function getnearestplayertoreticle()
  230. if player.Character then
  231. local lowest = math.huge
  232. local h = nil
  233. for i,v in pairs(game.Players:GetPlayers()) do
  234. if v and v ~= player and (v.TeamColor ~= player.TeamColor or aimbotTK) and v.Character and v.Character:FindFirstChild("Head") and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health > 0 then
  235. local offset = game.Workspace.CurrentCamera.CFrame.LookVector - lookat(game.Workspace.CurrentCamera.CFrame.Position, v.Character.Head.Position).LookVector
  236. distance = math.sqrt((offset.x * offset.x) + (offset.z * offset.z))
  237. if distance < lowest then
  238. lowest = distance
  239. h = v
  240. end
  241. end
  242. end
  243. return h
  244. end
  245. end
  246.  
  247. function lookat(target, eye)
  248. local forwardVector = (eye - target).Unit
  249. local upVector = Vector3.new(0, 1, 0)
  250. local rightVector = forwardVector:Cross(upVector)
  251. local upVector2 = rightVector:Cross(forwardVector)
  252.  
  253. return CFrame.fromMatrix(eye, rightVector, upVector2)
  254. end
  255.  
  256. function teleportbehindnearest()
  257. local h = getnearestplayer()
  258. if player and player.Character and h and h.Character and h.Character:FindFirstChild("Head") then
  259. if (player.Character.PrimaryPart.Position - h.Character.PrimaryPart.Position).magnitude < acceptableteleportdistance then
  260. player.Character:SetPrimaryPartCFrame(h.Character.Head.CFrame + (h.Character.Head.CFrame.LookVector * -3))
  261. game.Workspace.CurrentCamera.CFrame = lookat(game.Workspace.CurrentCamera.CFrame.Position, h.Character.Head.Position)
  262. if currenttool then
  263. currenttool:Activate()
  264. end
  265. else
  266. displayerror("No targets found. Try enabling AimbotTK")
  267. end
  268. end
  269. end
  270.  
  271.  
  272.  
  273. function aimbot()
  274. --Comment out the if statement if this doesn't work
  275. if snaptoreticle then
  276. h = getnearestplayertoreticle()
  277. else
  278. h = getnearestplayer()
  279. end
  280.  
  281. if h then
  282. game.Workspace.CurrentCamera.CFrame = lookat(game.Workspace.CurrentCamera.CFrame.Position, h.Character.Head.Position)
  283. else
  284. displayerror("No targets found. Try enabling AimbotTK")
  285. end
  286. end
  287.  
  288.  
  289. function translate(n)
  290. if player.Character and player.Character.PrimaryPart then
  291. player.Character:SetPrimaryPartCFrame(player.Character.PrimaryPart.CFrame + (game.Workspace.CurrentCamera.CFrame.LookVector * n))
  292. end
  293. end
  294.  
  295.  
  296. connections[1] = uis.InputBegan:Connect(function(a)
  297. if a.KeyCode == Enum.KeyCode.G and teleportenabled then
  298. translate(5)
  299. elseif a.KeyCode == Enum.KeyCode.H and teleportenabled then
  300. translate(10)
  301. end
  302.  
  303. if a.KeyCode == Enum.KeyCode.Semicolon then
  304. print("Connections cleared")
  305. clr = true
  306. for i,v in pairs(connections) do
  307. v:Disconnect()
  308. end
  309. if player.PlayerGui:FindFirstChild("Aimbot") then
  310. player.PlayerGui.Aimbot:Destroy()
  311. end
  312. end
  313. end)
  314.  
  315. connections[2] = player.CharacterAdded:Connect(function(char)
  316. connections[3] = char.ChildAdded:Connect(function(c)
  317. if c:IsA("Tool") then
  318. print("Tool found")
  319. currenttool = c
  320. end
  321. end)
  322. connections[4] = char.ChildRemoved:Connect(function(c)
  323. if c == currenttool then
  324. currenttool = nil
  325. end
  326. end)
  327. end)
  328.  
  329. connections[5] = gui.Frame.Drag.MouseButton1Down:Connect(function()
  330. buttondown = true
  331. while true do
  332. if (buttondown == false) or (clr == true) then
  333. return
  334. end
  335. rs.RenderStepped:Wait()
  336. gui.Frame.Position = UDim2.new(0, mouse.X - 125, 0, mouse.Y - 10)
  337. end
  338. end)
  339.  
  340. connections[6] = gui.Frame.Drag.MouseButton1Up:Connect(function()
  341. buttondown = false
  342. end)
  343.  
  344. connections[7] = gui.Frame.AimbotTK.MouseButton1Click:Connect(function()
  345. if aimbotTK == true then
  346. aimbotTK = false
  347. gui.Frame.AimbotTK.Text = ""
  348. else
  349. aimbotTK = true
  350. gui.Frame.AimbotTK.Text = "X"
  351. end
  352. end)
  353.  
  354. connections[8] = gui.Frame.Reticle.MouseButton1Click:Connect(function()
  355. if snaptoreticle == true then
  356. snaptoreticle = false
  357. gui.Frame.Reticle.Text = ""
  358. else
  359. snaptoreticle = true
  360. gui.Frame.Reticle.Text = "X"
  361. end
  362. end)
  363.  
  364. connections[9] = gui.Frame.Teleport.MouseButton1Down:Connect(function()
  365. if teleportenabled == true then
  366. teleportenabled = false
  367. gui.Frame.Teleport.Text = ""
  368. else
  369. teleportenabled = true
  370. gui.Frame.Teleport.Text = "X"
  371. end
  372. end)
  373.  
  374. connections[10] = gui.Frame.TeleportDist.Changed:Connect(function()
  375. if tonumber(gui.Frame.TeleportDist.Text) and tonumber(gui.Frame.TeleportDist.Text) > 0 then
  376. acceptableteleportdistance = tonumber(gui.Frame.TeleportDist.Text)
  377. print(acceptableteleportdistance)
  378. elseif gui.Frame.TeleportDist.Text ~= "" then
  379. displayerror("Must be a valid, positive integer.")
  380. end
  381. end)
  382.  
  383. while true do
  384. if uis:IsKeyDown(Enum.KeyCode.F) then
  385. aimbot()
  386. end
  387. if uis:IsKeyDown(Enum.KeyCode.Q) and teleportenabled then
  388. translate(2.5)
  389. end
  390. if uis:IsKeyDown(Enum.KeyCode.T) and teleportenabled then
  391. teleportbehindnearest()
  392. end
  393. if clr == true then return end
  394. wait(.05)
  395. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement