Advertisement
Guest User

FPS GUI v2 -AIMBOT AND ESP-

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