dusturafid

FPS AIMBOt

Feb 21st, 2020
3,754
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.01 KB | None | 0 0
  1. pcall(function()
  2. local espcolor = Color3.fromRGB(140, 69, 102)
  3. local wallhack_esp_transparency = .4
  4. local gui_hide_button = {Enum.KeyCode.LeftControl, "h"}
  5. local plrs = game:GetService("Players")
  6. local lplr = game:GetService("Players").LocalPlayer
  7. local TeamBased = true ; local teambasedswitch = "o"
  8. local presskeytoaim = true; local aimkey = "e"
  9. aimbothider = false; aimbothiderspeed = .5
  10. local Aim_Assist = false ; Aim_Assist_Key = {Enum.KeyCode.LeftControl, "z"}
  11. local espupdatetime = 5; autoesp = false
  12. local abs = math.abs
  13. local mouselock = false
  14. local canaimat = true
  15. local lockaim = true; local lockangle = 5
  16. local ver = "2"
  17. local cam = game.Workspace.CurrentCamera
  18. local BetterDeathCount = true
  19.  
  20.  
  21. local mouse = lplr:GetMouse()
  22. local switch = false
  23. local key = "k"
  24. local aimatpart = nil
  25.  
  26.  
  27.  
  28.  
  29. local Gui = Instance.new("ScreenGui")
  30. local Move = Instance.new("Frame")
  31. local Main = Instance.new("Frame")
  32. local EspStatus = Instance.new("TextLabel")
  33. local st1 = Instance.new("TextLabel")
  34. local st1_2 = Instance.new("TextLabel")
  35. local st1_3 = Instance.new("TextLabel")
  36. local Name = Instance.new("TextLabel")
  37. --Properties:
  38.  
  39. Gui.Parent = plrs.LocalPlayer:WaitForChild("PlayerGui")
  40.  
  41.  
  42.  
  43. local gotstring = 0
  44. local function getrandomstring()
  45. gotstring = gotstring+666
  46. local str = ""
  47. local randomstring = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "g", "k", "l", "m", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
  48. "?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?", "`", "$",
  49. "0","1","2","3","4","5","6","7","8","9", }
  50. local counting123 = 0
  51. for i, v in ipairs(randomstring) do
  52. counting123 = i
  53. end
  54. do
  55. math.randomseed(tick()+gotstring)
  56. for i = 3, math.random(1,100) do
  57. math.randomseed(i+tick()+gotstring)
  58.  
  59. local oneortwo = math.random(1,2)
  60. if oneortwo == 2 then
  61. math.randomseed(i+tick()+gotstring)
  62. str = str..""..randomstring[math.random(1, counting123)]
  63. else
  64. math.randomseed(i+tick()+gotstring)
  65. str = str..""..string.upper(randomstring[math.random(1, counting123)])
  66. end
  67.  
  68. end
  69. end
  70. return str
  71. end
  72. local mousedown = false
  73. local isonmovething = false
  74. local mouseoffset = Vector2.new()
  75. local mousedown = false
  76.  
  77.  
  78.  
  79.  
  80. Gui.Name = getrandomstring()
  81. Gui.Enabled = false
  82.  
  83. Move.Name = getrandomstring()
  84. Move.Draggable = true
  85. Move.Parent = Gui
  86. Move.BackgroundColor3 = Color3.new(0.0431373, 1, 0.0745098)
  87. Move.BackgroundTransparency = 0.40000000596046
  88. Move.BorderSizePixel = 0
  89. Move.Position = UDim2.new(0.5, 0,0.018, 0)
  90. Move.Size = UDim2.new(0.2, 0, 0.0320388414, 0)
  91. Move.Visible = false
  92.  
  93. Move.MouseEnter:Connect(function()
  94.  
  95. isonmovething = true
  96.  
  97. end)
  98. Move.MouseLeave:Connect(function()
  99.  
  100. isonmovething = mousedown and true or false
  101. end)
  102. mouse.Button1Down:connect(function()
  103. mousedown = true
  104. mouseoffset = Move.AbsolutePosition - Vector2.new(mouse.X, mouse.Y)
  105. end)
  106. mouse.Button1Up:connect(function()
  107. mousedown = false
  108. end)
  109.  
  110. mouse.Move:Connect(function()
  111. if isonmovething == true and mousedown then
  112. Move.Position = UDim2.new(0, mouseoffset.X + mouse.X, 0, mouseoffset.Y + mouse.Y)
  113. end
  114. end)
  115.  
  116. Main.Name = getrandomstring()
  117. Main.Parent = Move
  118. Main.BackgroundColor3 = Color3.new(0.176471, 0.176471, 0.176471)
  119. Main.BackgroundTransparency = 0.69999998807907
  120. Main.Position = UDim2.new(0, 0, 0.995670795, 0)
  121. Main.Size = UDim2.new(1.0000006, 0, 11.2, 0)
  122.  
  123. EspStatus.Name = getrandomstring()
  124. EspStatus.Parent = Main
  125. EspStatus.BackgroundColor3 = Color3.new(1, 1, 1)
  126. EspStatus.BackgroundTransparency = 1
  127. EspStatus.Size = UDim2.new(0.272955924, 0, 0.161862016, 0)
  128. EspStatus.Font = Enum.Font.ArialBold
  129. EspStatus.Text = "Press T to update Esp"
  130. EspStatus.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  131. EspStatus.TextScaled = true
  132. EspStatus.TextSize = 14
  133. EspStatus.TextWrapped = true
  134.  
  135. st1.Name = getrandomstring()
  136. st1.Parent = Main
  137. st1.BackgroundColor3 = Color3.new(1, 1, 1)
  138. st1.BackgroundTransparency = 1
  139. st1.Position = UDim2.new(0.271787882, 0, 0, 0)
  140. st1.Size = UDim2.new(0.728211343, 0, 0.161862016, 0)
  141. st1.Font = Enum.Font.ArialBold
  142. st1.Text = "Press "..aimkey.." to lock on a person inside ur view"
  143. st1.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  144. st1.TextScaled = true
  145. st1.TextSize = 14
  146. st1.TextWrapped = true
  147.  
  148. st1_2.Name = getrandomstring()
  149. st1_2.Parent = Main
  150. st1_2.BackgroundColor3 = Color3.new(1, 1, 1)
  151. st1_2.BackgroundTransparency = 1
  152. st1_2.Position = UDim2.new(0, 0, 0.375590861, 0)
  153. st1_2.Size = UDim2.new(0.999999881, 0, 0.161862016, 0)
  154. st1_2.Font = Enum.Font.ArialBold
  155. st1_2.Text = "Press L to enable esp loop. Press Y to disable/enable aimbot hider"
  156. st1_2.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  157. st1_2.TextScaled = true
  158. st1_2.TextSize = 14
  159. st1_2.TextWrapped = true
  160.  
  161. local aimbothiderbox = Instance.new("TextBox")
  162. aimbothiderbox.Name = getrandomstring()
  163. aimbothiderbox.Text = "Speed :"..tostring(aimbothiderspeed).." off"
  164. aimbothiderbox.Size = UDim2.new(1, 0,0.162, 0)
  165. aimbothiderbox.TextScaled = true
  166. aimbothiderbox.TextColor3 =Color3.fromRGB(255, 0, 0)
  167. aimbothiderbox.Position = UDim2.new(0, 0,0.853, 0)
  168. aimbothiderbox.BackgroundTransparency = 1
  169. aimbothiderbox.Parent = Main
  170.  
  171. st1_3.Name = getrandomstring()
  172. st1_3.Parent = Main
  173. st1_3.BackgroundColor3 = Color3.new(1, 1, 1)
  174. st1_3.BackgroundTransparency = 1
  175. st1_3.Position = UDim2.new(0, 0, 0.18558608, 0)
  176. st1_3.Size = UDim2.new(0.999999881, 0, 0.161862016, 0)
  177. st1_3.Font = Enum.Font.ArialBold
  178. st1_3.Text = "Press O to change team based mode"
  179. st1_3.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  180. st1_3.TextScaled = true
  181. st1_3.TextSize = 14
  182. st1_3.TextWrapped = true
  183. local teambasedstatus = st1_3:Clone()
  184. teambasedstatus.Parent = Main
  185. teambasedstatus.TextScaled = true
  186. teambasedstatus.Position = UDim2.new(0, 0,.7, 0)
  187. teambasedstatus.Size = UDim2.new(1, 0,.1, 0)
  188. teambasedstatus.Name = getrandomstring()
  189. teambasedstatus.Text = "Team Based: "..tostring(TeamBased)
  190. local espstatustext = teambasedstatus:Clone()
  191. espstatustext.Name = getrandomstring()
  192. espstatustext.Position = UDim2.new(0, 0,0.58, 0)
  193. espstatustext.Text = "Esp loop :"..tostring(autoesp)
  194. espstatustext.Parent = Main
  195. local hide = Instance.new("TextButton")
  196. hide.Text = "_"
  197. hide.BackgroundTransparency = 1
  198. hide.TextScaled = true
  199. hide.TextWrapped = true
  200. hide.Size = UDim2.new(0.1, 0,1, 0)
  201. hide.Position = UDim2.new(0.9, 0,-0.15, 0)
  202. hide.Name = getrandomstring()
  203. hide.Parent = Move
  204. Name.Name = getrandomstring()
  205. Name.Parent = Move
  206. Name.BackgroundColor3 = Color3.new(1, 1, 1)
  207. Name.BackgroundTransparency = 1
  208. Name.Size = UDim2.new(0.838, 0, 1, 0)
  209. Name.Font = Enum.Font.Arial
  210. Name.Text = "FPS gui v"..ver
  211. Name.TextColor3 = Color3.new(0, 0, 0)
  212. Name.TextScaled = true
  213. Name.TextSize = 14
  214. Name.TextWrapped = true
  215. Name.TextXAlignment = Enum.TextXAlignment.Left
  216. local scr = Instance.new("ScrollingFrame")
  217. scr.Size = Main.Size
  218. scr.Position = Main.Position
  219. scr.ScrollBarThickness = 0
  220. scr.BackgroundTransparency = 1
  221. scr.Name = getrandomstring()
  222. Main.Size = UDim2.new(1, 0, 1, 0)
  223. Main.Position = UDim2.new(0,0,0,0)
  224. Main.Parent = scr
  225. scr.Parent = Move
  226. startpos = Main.Position
  227. Move.Active = true
  228.  
  229. -- Scripts:
  230. hided = false
  231. hide.MouseButton1Click:Connect(function()
  232. if hided == false then
  233. hided = true
  234. Main:TweenPosition(UDim2.new(0, 0, -1.5, 0))
  235. else
  236. hided = false
  237. Main:TweenPosition(startpos)
  238. end
  239. end)
  240.  
  241.  
  242. aimbothiderbox.FocusLost:Connect(function()
  243. local numb = tonumber(aimbothiderbox.Text)
  244. if aimbothider == true then
  245. aimbothiderbox.TextColor3 =Color3.fromRGB(11, 255, 19)
  246. else
  247. aimbothiderbox.TextColor3 =Color3.fromRGB(255, 0, 0)
  248. end
  249. if numb ~= nil then
  250. aimbothiderspeed = numb
  251. if aimbothider == true then
  252. aimbothiderbox.Text = "Speed :"..tostring(aimbothiderspeed).." on"
  253. else
  254. aimbothiderbox.Text = "Speed :"..tostring(aimbothiderspeed).." off"
  255. end
  256. else
  257. if aimbothider == true then
  258. aimbothiderbox.Text = "Speed :"..tostring(aimbothiderspeed).." on"
  259. else
  260. aimbothiderbox.Text = "Speed :"..tostring(aimbothiderspeed).." off"
  261. end
  262. end
  263. end)
  264.  
  265.  
  266. local plrsforaim = {}
  267.  
  268.  
  269. Move.Draggable = true
  270. Gui.ResetOnSpawn = false
  271. --Gui.Name = "Chat"
  272. Gui.DisplayOrder = 999
  273. if not game:GetService("CoreGui") then
  274. Gui.Parent = plrs.LocalPlayer.PlayerGui
  275. else
  276. Gui.Parent = game:GetService("CoreGui")
  277. end
  278.  
  279.  
  280.  
  281.  
  282.  
  283. f = {}
  284. local espforlder
  285. local partconverter = Instance.new("Part")
  286.  
  287. f.addesp = function()
  288. pcall(function()
  289. --print("ESP ran")
  290. if espforlder then
  291. espforlder:Destroy()
  292. espforlder = Instance.new("Folder")
  293. espforlder.Parent = game.Workspace.CurrentCamera
  294. else
  295. espforlder = Instance.new("Folder")
  296. espforlder.Parent = game.Workspace.CurrentCamera
  297. end
  298. for i, v in pairs(espforlder:GetChildren()) do
  299. v:Destroy()
  300. end
  301. for _, plr in pairs(plrs:GetChildren()) do
  302. if plr.Character and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name then
  303. if TeamBased == true then
  304. if plr.Team.Name ~= plrs.LocalPlayer.Team.Name  then
  305. local e = espforlder:FindFirstChild(plr.Name)
  306. if not e then
  307. local fold = Instance.new("Folder", espforlder)
  308. fold.Name = plr.Name
  309.  
  310. --partconverter.BrickColor = plr.Team.Color
  311. --local teamc = partconverter.Color
  312. for i, p in pairs(plr.Character:GetChildren()) do
  313. if p:IsA("BasePart") and p.Name ~= "HumanoidRootPart" then
  314. local urmom = Instance.new("BoxHandleAdornment")
  315. urmom.ZIndex = 10
  316. urmom.AlwaysOnTop = true
  317. urmom.Color3 = espcolor
  318. urmom.Size = p.Size
  319. urmom.Adornee = p
  320. urmom.Name = tick().." Ur mom has big gay"
  321. urmom.Transparency = wallhack_esp_transparency
  322. urmom.Parent = fold
  323.  
  324. end
  325. end
  326. plr.Character.Humanoid.Died:Connect(function()
  327. fold:Destroy()
  328. end)
  329. end
  330. end
  331. else
  332. local e = espforlder:FindFirstChild(plr.Name)
  333. if not e then
  334. local fold = Instance.new("Folder", espforlder)
  335. fold.Name = plr.Name
  336.  
  337. --partconverter.BrickColor = plr.Team.Color
  338. --local teamc = Move.BackgroundColor3
  339. for i, p in pairs(plr.Character:GetChildren()) do
  340. if p:IsA("BasePart") and p.Name ~= "HumanoidRootPart" then
  341. local urmom = Instance.new("BoxHandleAdornment")
  342. urmom.ZIndex = 10
  343. urmom.AlwaysOnTop = true
  344. urmom.Color3 = espcolor
  345. urmom.Size = p.Size
  346. urmom.Adornee = p
  347. urmom.Name = tick().." Ur mom has big gay"
  348. urmom.Transparency = wallhack_esp_transparency
  349. urmom.Parent = fold
  350. end
  351. end
  352. plr.Character.Humanoid.Died:Connect(function()
  353. fold:Destroy()
  354. end)
  355. end
  356. end
  357.  
  358.  
  359. end
  360. end
  361. end)
  362. end
  363. local uis = game:GetService("UserInputService")
  364. local bringall = false
  365. local hided2 = false
  366. mouse.KeyDown:Connect(function(a)
  367. if a == "t" then
  368. --print("worked1")
  369. f.addesp()
  370. elseif a == gui_hide_button[2] and uis:IsKeyDown(gui_hide_button[1]) then
  371. if hided2 == false then
  372. hided2 = true
  373. autoesp =false
  374. if espforlder then
  375. espforlder:Destroy()
  376. end
  377. Gui.Enabled = false
  378. else
  379. Gui.Enabled = true
  380. hided2 = false
  381. end
  382. elseif a == "u" then
  383. if mouselock == false then
  384. mouselock = true
  385. else
  386. mouselock = false
  387. end
  388. elseif a == "y" then
  389. if aimbothider == false then
  390. aimbothider = true
  391. if aimbothider == true then
  392. aimbothiderbox.Text = "Speed :"..tostring(aimbothiderspeed).." on"
  393. else
  394. aimbothiderbox.Text = "Speed :"..tostring(aimbothiderspeed).." off"
  395. end
  396. else
  397.  
  398. aimbothider = false
  399. if aimbothider == true then
  400. aimbothiderbox.Text = "Speed :"..tostring(aimbothiderspeed).." on"
  401. else
  402. aimbothiderbox.Text = "Speed :"..tostring(aimbothiderspeed).." off"
  403. end
  404. end
  405. if aimbothider == true then
  406. aimbothiderbox.TextColor3 =Color3.fromRGB(11, 255, 19)
  407. else
  408. aimbothiderbox.TextColor3 =Color3.fromRGB(255, 0, 0)
  409. end
  410. elseif a == "l" then
  411. if autoesp == false then
  412. autoesp = true
  413. else
  414. autoesp = false
  415. end
  416. elseif a == Aim_Assist_Key[2] and uis:IsKeyDown(Aim_Assist_Key[1]) then
  417. if Aim_Assist == true then
  418. Aim_Assist = false
  419. --print("disabled")
  420. else
  421. Aim_Assist = true
  422. end
  423. end
  424. if a == "j" then
  425. if mouse.Target then
  426. mouse.Target:Destroy()
  427. end
  428. end
  429. if a == key then
  430. if switch == false then
  431. switch = true
  432. else
  433. switch = false
  434. if aimatpart ~= nil then
  435. aimatpart = nil
  436. end
  437. end
  438. elseif a == teambasedswitch then
  439. if TeamBased == true then
  440. TeamBased = false
  441. teambasedstatus.Text = "Team Based: "..tostring(TeamBased)
  442. else
  443. TeamBased = true
  444. teambasedstatus.Text = "Team Based: "..tostring(TeamBased)
  445. end
  446. elseif a == aimkey then
  447. if not aimatpart then
  448. local maxangle = math.rad(20)
  449. for i, plr in pairs(plrs:GetChildren()) do
  450. if plr.Name ~= lplr.Name and plr.Character and plr.Character.Head and plr.Character.Humanoid and plr.Character.Humanoid.Health > 1 then
  451. if TeamBased == true then
  452. if plr.Team.Name ~= lplr.Team.Name then
  453. local an = checkfov(plr.Character.Head)
  454. if an < maxangle then
  455. maxangle = an
  456. aimatpart = plr.Character.Head
  457. end
  458. end
  459. else
  460. local an = checkfov(plr.Character.Head)
  461. if an < maxangle then
  462. maxangle = an
  463. aimatpart = plr.Character.Head
  464. end
  465. --print(plr)
  466. end
  467. local old = aimatpart
  468. plr.Character.Humanoid.Died:Connect(function()
  469. --print("died")
  470. if aimatpart and aimatpart == old then
  471. aimatpart = nil
  472. end
  473. end)
  474.  
  475. end
  476. end
  477. else
  478. aimatpart = nil
  479. canaimat = false
  480. delay(1.1, function()
  481. canaimat = true
  482. end)
  483. end
  484. end
  485. end)
  486.  
  487. function getfovxyz (p0, p1, deg)
  488. local x1, y1, z1 = p0:ToOrientation()
  489. local cf = CFrame.new(p0.p, p1.p)
  490. local x2, y2, z2 = cf:ToOrientation()
  491. local d = math.deg
  492. if deg then
  493. return Vector3.new(d(x1-x2), d(y1-y2), d(z1-z2))
  494. else
  495. return Vector3.new((x1-x2), (y1-y2), (z1-z2))
  496. end
  497. end
  498.  
  499.  
  500. function aimat(part)
  501. if part then
  502. if aimbothider == true or Aim_Assist == true then
  503. cam.CFrame = cam.CFrame:Lerp(CFrame.new(cam.CFrame.p, part.CFrame.p), aimbothiderspeed)
  504. else
  505.  
  506. cam.CFrame = CFrame.new(cam.CFrame.p, part.CFrame.p)
  507. end
  508. end
  509. end
  510. function checkfov (part)
  511. local fov = getfovxyz(game.Workspace.CurrentCamera.CFrame, part.CFrame)
  512. local angle = math.abs(fov.X) + math.abs(fov.Y)
  513. return angle
  514. end
  515. pcall(function()
  516. delay(0, function()
  517. while wait(.4) do
  518. if Aim_Assist and not aimatpart and canaimat and lplr.Character and lplr.Character.Humanoid and lplr.Character.Humanoid.Health > 0 then
  519. for i, plr in pairs(plrs:GetChildren()) do
  520.  
  521.  
  522. local minangle = math.rad(5.5)
  523. local lastpart = nil
  524. local function gg(plr)
  525. pcall(function()
  526. if plr.Name ~= lplr.Name and plr.Character and plr.Character.Humanoid and plr.Character.Humanoid.Health > 0 and plr.Character.Head then
  527. local raycasted = false
  528. local cf1 = CFrame.new(cam.CFrame.p, plr.Character.Head.CFrame.p) * CFrame.new(0, 0, -4)
  529. local r1 = Ray.new(cf1.p, cf1.LookVector * 9000)
  530. local obj, pos = game.Workspace:FindPartOnRayWithIgnoreList(r1,  {lplr.Character.Head})
  531. local dist = (plr.Character.Head.CFrame.p- pos).magnitude
  532. if dist < 4 then
  533. raycasted = true
  534. end
  535. if raycasted == true then
  536. local an1 = getfovxyz(cam.CFrame, plr.Character.Head.CFrame)
  537. local an = abs(an1.X) + abs(an1.Y)
  538. if an < minangle then
  539. minangle = an
  540. lastpart = plr.Character.Head
  541. end
  542. end
  543. end
  544. end)
  545. end
  546. if TeamBased then
  547. if plr.Team.Name ~= lplr.Team.Name then
  548. gg(plr)
  549. end
  550. else
  551. gg(plr)
  552. end
  553. --print(math.deg(minangle))
  554. if lastpart then
  555. aimatpart = lastpart
  556. aimatpart.Parent.Humanoid.Died:Connect(function()
  557. if aimatpart == lastpart then
  558. aimatpart = nil
  559. end
  560. end)
  561.  
  562. end
  563. end
  564. end
  565. end
  566. end)
  567. end)
  568. local oldheadpos
  569. local lastaimapart
  570. game:GetService("RunService").RenderStepped:Connect(function()
  571. espstatustext.Text = "Esp loop :"..tostring(autoesp)
  572. if aimatpart and lplr.Character and lplr.Character.Head then
  573. if BetterDeathCount and lastaimapart and lastaimapart == aimatpart then
  574. local dist = (oldheadpos - aimatpart.CFrame.p).magnitude
  575. if dist > 40 then
  576. aimatpart = nil
  577. end
  578. end
  579. lastaimapart = aimatpart
  580. oldheadpos = lastaimapart.CFrame.p
  581. do
  582. if aimatpart.Parent == plrs.LocalPlayer.Character then
  583. aimatpart = nil
  584. end
  585. aimat(aimatpart)
  586. pcall(function()
  587. if Aim_Assist == true then
  588. local cf1 = CFrame.new(cam.CFrame.p, aimatpart.CFrame.p) * CFrame.new(0, 0, -4)
  589. local r1 = Ray.new(cf1.p, cf1.LookVector * 1000)
  590. local obj, pos = game.Workspace:FindPartOnRayWithIgnoreList(r1,  {lplr.Character.Head})
  591. local dist = (aimatpart.CFrame.p- pos).magnitude
  592. if obj then
  593. --print(obj:GetFullName())
  594. end
  595. if not obj or dist > 6 then
  596. aimatpart = nil
  597. --print("ooof")
  598. end
  599. canaimat = false
  600. delay(.5, function()
  601. canaimat = true
  602. end)
  603. end
  604. end)
  605. end
  606.  
  607.  
  608.  
  609. end
  610. end)
  611. delay(0, function()
  612. while wait(espupdatetime) do
  613. if autoesp == true then
  614. pcall(function()
  615. f.addesp()
  616. end)
  617. end
  618. end
  619. end)
  620. --warn("loaded")
  621. end)
Add Comment
Please, Sign In to add comment