ninojesse

Arsenal

Feb 15th, 2020
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.31 KB | None | 0 0
  1. local plrs = game:GetService("Players")
  2.  
  3. local TeamBased = true ; local teambasedswitch = "o"
  4.  
  5. local presskeytoaim = true; local aimkey = "e"
  6.  
  7. local raycast = false
  8.  
  9.  
  10.  
  11. local espupdatetime = 5; autoesp = false
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19. local lockaim = true; local lockangle = 5
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. --function findwat(folder, what)
  28.  
  29. -- for i, smth in pairs(folder:GetChildren()) do
  30.  
  31. -- if string.find(string.lower(tostring(smth)), string.lower(what)) then
  32.  
  33. -- return smth
  34.  
  35. -- end
  36.  
  37. -- end
  38.  
  39. --end
  40.  
  41. --
  42.  
  43. --local plrs = findwat(game, "Players")
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. local Gui = Instance.new("ScreenGui")
  54.  
  55. local Move = Instance.new("Frame")
  56.  
  57. local Main = Instance.new("Frame")
  58.  
  59. local EspStatus = Instance.new("TextLabel")
  60.  
  61. local st1 = Instance.new("TextLabel")
  62.  
  63. local st1_2 = Instance.new("TextLabel")
  64.  
  65. local st1_3 = Instance.new("TextLabel")
  66.  
  67. local Name = Instance.new("TextLabel")
  68.  
  69. --Properties:
  70.  
  71. Gui.Name = "Gui"
  72.  
  73. Gui.Parent = plrs.LocalPlayer:WaitForChild("PlayerGui")
  74.  
  75.  
  76.  
  77. Move.Name = "Move"
  78.  
  79. Move.Parent = Gui
  80.  
  81. Move.BackgroundColor3 = Color3.new(0.0431373, 1, 0.0745098)
  82.  
  83. Move.BackgroundTransparency = 0.40000000596046
  84.  
  85. Move.BorderSizePixel = 0
  86.  
  87. Move.Position = UDim2.new(0.005, 0,0.018, 0)
  88.  
  89. Move.Size = UDim2.new(0.28141585, 0, 0.0320388414, 0)
  90.  
  91.  
  92.  
  93. Main.Name = "Main"
  94.  
  95. Main.Parent = Move
  96.  
  97. Main.BackgroundColor3 = Color3.new(0.176471, 0.176471, 0.176471)
  98.  
  99. Main.BackgroundTransparency = 0.69999998807907
  100.  
  101. Main.Position = UDim2.new(0, 0, 0.995670795, 0)
  102.  
  103. Main.Size = UDim2.new(1.0000006, 0, 9.79697132, 0)
  104.  
  105.  
  106.  
  107. EspStatus.Name = "EspStatus"
  108.  
  109. EspStatus.Parent = Main
  110.  
  111. EspStatus.BackgroundColor3 = Color3.new(1, 1, 1)
  112.  
  113. EspStatus.BackgroundTransparency = 1
  114.  
  115. EspStatus.Size = UDim2.new(0.272955924, 0, 0.161862016, 0)
  116.  
  117. EspStatus.Font = Enum.Font.ArialBold
  118.  
  119. EspStatus.Text = "Press T to update Esp"
  120.  
  121. EspStatus.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  122.  
  123. EspStatus.TextScaled = true
  124.  
  125. EspStatus.TextSize = 14
  126.  
  127. EspStatus.TextWrapped = true
  128.  
  129.  
  130.  
  131. st1.Name = "st1"
  132.  
  133. st1.Parent = Main
  134.  
  135. st1.BackgroundColor3 = Color3.new(1, 1, 1)
  136.  
  137. st1.BackgroundTransparency = 1
  138.  
  139. st1.Position = UDim2.new(0.271787882, 0, 0, 0)
  140.  
  141. st1.Size = UDim2.new(0.728211343, 0, 0.161862016, 0)
  142.  
  143. st1.Font = Enum.Font.ArialBold
  144.  
  145. st1.Text = "Press "..aimkey.." to lock on a person inside ur view"
  146.  
  147. st1.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  148.  
  149. st1.TextScaled = true
  150.  
  151. st1.TextSize = 14
  152.  
  153. st1.TextWrapped = true
  154.  
  155.  
  156.  
  157. st1_2.Name = "st1"
  158.  
  159. st1_2.Parent = Main
  160.  
  161. st1_2.BackgroundColor3 = Color3.new(1, 1, 1)
  162.  
  163. st1_2.BackgroundTransparency = 1
  164.  
  165. st1_2.Position = UDim2.new(0, 0, 0.375590861, 0)
  166.  
  167. st1_2.Size = UDim2.new(0.999999881, 0, 0.161862016, 0)
  168.  
  169. st1_2.Font = Enum.Font.ArialBold
  170.  
  171. st1_2.Text = "Press L to enable esp loop"
  172.  
  173. st1_2.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  174.  
  175. st1_2.TextScaled = true
  176.  
  177. st1_2.TextSize = 14
  178.  
  179. st1_2.TextWrapped = true
  180.  
  181.  
  182.  
  183. st1_3.Name = "st1"
  184.  
  185. st1_3.Parent = Main
  186.  
  187. st1_3.BackgroundColor3 = Color3.new(1, 1, 1)
  188.  
  189. st1_3.BackgroundTransparency = 1
  190.  
  191. st1_3.Position = UDim2.new(0, 0, 0.18558608, 0)
  192.  
  193. st1_3.Size = UDim2.new(0.999999881, 0, 0.161862016, 0)
  194.  
  195. st1_3.Font = Enum.Font.ArialBold
  196.  
  197. st1_3.Text = "Press O to change team based mode"
  198.  
  199. st1_3.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  200.  
  201. st1_3.TextScaled = true
  202.  
  203. st1_3.TextSize = 14
  204.  
  205. st1_3.TextWrapped = true
  206.  
  207. local teambasedstatus = st1_3:Clone()
  208.  
  209. teambasedstatus.Parent = st1_3
  210.  
  211. teambasedstatus.TextScaled = true
  212.  
  213. teambasedstatus.Position = UDim2.new(0, 0,0.694, 0)
  214.  
  215. teambasedstatus.Text = tostring(TeamBased)
  216.  
  217.  
  218.  
  219. Name.Name = "Name"
  220.  
  221. Name.Parent = Move
  222.  
  223. Name.BackgroundColor3 = Color3.new(1, 1, 1)
  224.  
  225. Name.BackgroundTransparency = 1
  226.  
  227. Name.Size = UDim2.new(0.838, 0, 0.980000019, 0)
  228.  
  229. Name.Font = Enum.Font.Arial
  230.  
  231. Name.Text = "FPS gui v1.0"
  232.  
  233. Name.TextColor3 = Color3.new(0, 0, 0)
  234.  
  235. Name.TextScaled = true
  236.  
  237. Name.TextSize = 14
  238.  
  239. Name.TextWrapped = true
  240.  
  241. Name.TextXAlignment = Enum.TextXAlignment.Left
  242.  
  243. -- Scripts:
  244.  
  245.  
  246.  
  247.  
  248.  
  249. local plrsforaim = {}
  250.  
  251.  
  252.  
  253. local lplr = game:GetService("Players").LocalPlayer
  254.  
  255. Move.Draggable = true
  256.  
  257. Gui.ResetOnSpawn = false
  258.  
  259. Gui.Name = "Chat"
  260.  
  261. Gui.DisplayOrder = 999
  262.  
  263.  
  264.  
  265. Gui.Parent = plrs.LocalPlayer.PlayerGui
  266.  
  267.  
  268.  
  269.  
  270.  
  271. f = {}
  272.  
  273. local espforlder
  274.  
  275.  
  276.  
  277. f.addesp = function()
  278.  
  279. --print("ESP ran")
  280.  
  281. if espforlder then
  282.  
  283. else
  284.  
  285. espforlder = Instance.new("Folder")
  286.  
  287. espforlder.Parent = game.Workspace.CurrentCamera
  288.  
  289. end
  290.  
  291. for i, v in pairs(espforlder:GetChildren()) do
  292.  
  293. v:Destroy()
  294.  
  295. end
  296.  
  297. for _, plr in pairs(plrs:GetChildren()) do
  298.  
  299. if plr.Character and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name then
  300.  
  301. if TeamBased == true then
  302.  
  303. if plr.Team.Name ~= plrs.LocalPlayer.Team.Name then
  304.  
  305. local e = espforlder:FindFirstChild(plr.Name)
  306.  
  307. if not e then
  308.  
  309. --print("Added esp for team based")
  310.  
  311. local bill = Instance.new("BillboardGui", espforlder)
  312.  
  313. bill.Name = plr.Name
  314.  
  315. bill.AlwaysOnTop = true
  316.  
  317. bill.Size = UDim2.new(1,0,1,0)
  318.  
  319. bill.Adornee = plr.Character.Head
  320.  
  321. local Frame = Instance.new('Frame',bill)
  322.  
  323. Frame.Active = true
  324.  
  325. Frame.BackgroundColor3 = Color3.new(0/255,255/255,0/255)
  326.  
  327. Frame.BackgroundTransparency = 0
  328.  
  329. Frame.BorderSizePixel = 0
  330.  
  331. Frame.AnchorPoint = Vector2.new(.5, .5)
  332.  
  333. Frame.Position = UDim2.new (0.5,0,0.5,0)
  334.  
  335. Frame.Size = UDim2.new (1,0,1,0)
  336.  
  337. Frame.Rotation = 0
  338.  
  339. plr.Character.Humanoid.Died:Connect(function()
  340.  
  341. bill:Destroy()
  342.  
  343. end)
  344.  
  345. end
  346.  
  347. end
  348.  
  349. else
  350.  
  351. local e = espforlder:FindFirstChild(plr.Name)
  352.  
  353. if not e then
  354.  
  355. --print("Added esp")
  356.  
  357. local bill = Instance.new("BillboardGui", espforlder)
  358.  
  359. bill.Name = plr.Name
  360.  
  361. bill.AlwaysOnTop = true
  362.  
  363. bill.Size = UDim2.new(1,0,1,0)
  364.  
  365. bill.Adornee = plr.Character.Head
  366.  
  367. local Frame = Instance.new('Frame',bill)
  368.  
  369. Frame.Active = true
  370.  
  371. Frame.BackgroundColor3 = Color3.new(0/255,255/255,0/255)
  372.  
  373. Frame.BackgroundTransparency = 0
  374.  
  375. Frame.BorderSizePixel = 0
  376.  
  377. Frame.AnchorPoint = Vector2.new(.5, .5)
  378.  
  379. Frame.Position = UDim2.new (0.5,0,0.5,0)
  380.  
  381. Frame.Size = UDim2.new (1,0,1,0)
  382.  
  383. Frame.Rotation = 0
  384.  
  385. plr.Character.Humanoid.Died:Connect(function()
  386.  
  387. bill:Destroy()
  388.  
  389. end)
  390.  
  391. end
  392.  
  393. end
  394.  
  395.  
  396.  
  397.  
  398.  
  399. end
  400.  
  401. end
  402.  
  403. end
  404.  
  405. local cam = game.Workspace.CurrentCamera
  406.  
  407.  
  408.  
  409. local mouse = lplr:GetMouse()
  410.  
  411. local switch = false
  412.  
  413. local key = "k"
  414.  
  415. local aimatpart = nil
  416.  
  417. mouse.KeyDown:Connect(function(a)
  418.  
  419. if a == "t" then
  420.  
  421. print("worked1")
  422.  
  423. f.addesp()
  424.  
  425. elseif a == "u" then
  426.  
  427. if raycast == true then
  428.  
  429. raycast = false
  430.  
  431. else
  432.  
  433. raycast = true
  434.  
  435. end
  436.  
  437. elseif a == "l" then
  438.  
  439. if autoesp == false then
  440.  
  441. autoesp = true
  442.  
  443. else
  444.  
  445. autoesp = false
  446.  
  447. end
  448.  
  449. end
  450.  
  451. if a == "j" then
  452.  
  453. if mouse.Target then
  454.  
  455. mouse.Target:Destroy()
  456.  
  457. end
  458.  
  459. end
  460.  
  461. if a == key then
  462.  
  463. if switch == false then
  464.  
  465. switch = true
  466.  
  467. else
  468.  
  469. switch = false
  470.  
  471. if aimatpart ~= nil then
  472.  
  473. aimatpart = nil
  474.  
  475. end
  476.  
  477. end
  478.  
  479. elseif a == teambasedswitch then
  480.  
  481. if TeamBased == true then
  482.  
  483. TeamBased = false
  484.  
  485. teambasedstatus.Text = tostring(TeamBased)
  486.  
  487. else
  488.  
  489. TeamBased = true
  490.  
  491. teambasedstatus.Text = tostring(TeamBased)
  492.  
  493. end
  494.  
  495. elseif a == aimkey then
  496.  
  497. if not aimatpart then
  498.  
  499. local maxangle = math.rad(20)
  500.  
  501. for i, plr in pairs(plrs:GetChildren()) do
  502.  
  503. if plr.Name ~= lplr.Name and plr.Character and plr.Character.Head and plr.Character.Humanoid and plr.Character.Humanoid.Health > 1 then
  504.  
  505. if TeamBased == true then
  506.  
  507. if plr.Team.Name ~= lplr.Team.Name then
  508.  
  509. local an = checkfov(plr.Character.Head)
  510.  
  511. if an < maxangle then
  512.  
  513. maxangle = an
  514.  
  515. aimatpart = plr.Character.Head
  516.  
  517. end
  518.  
  519. end
  520.  
  521. else
  522.  
  523. local an = checkfov(plr.Character.Head)
  524.  
  525. if an < maxangle then
  526.  
  527. maxangle = an
  528.  
  529. aimatpart = plr.Character.Head
  530.  
  531. end
  532.  
  533. print(plr)
  534.  
  535. end
  536.  
  537. plr.Character.Humanoid.Died:Connect(function()
  538.  
  539. if aimatpart.Parent == plr.Character or aimatpart == nil then
  540.  
  541. aimatpart = nil
  542.  
  543. end
  544.  
  545. end)
  546.  
  547. end
  548.  
  549. end
  550.  
  551. else
  552.  
  553. aimatpart = nil
  554.  
  555. end
  556.  
  557. end
  558.  
  559. end)
  560.  
  561.  
  562.  
  563. function getfovxyz (p0, p1, deg)
  564.  
  565. local x1, y1, z1 = p0:ToOrientation()
  566.  
  567. local cf = CFrame.new(p0.p, p1.p)
  568.  
  569. local x2, y2, z2 = cf:ToOrientation()
  570.  
  571. --local d = math.deg
  572.  
  573. if deg then
  574.  
  575. --return Vector3.new(d(x1-x2), d(y1-y2), d(z1-z2))
  576.  
  577. else
  578.  
  579. return Vector3.new((x1-x2), (y1-y2), (z1-z2))
  580.  
  581. end
  582.  
  583. end
  584.  
  585.  
  586.  
  587. function getaimbotplrs()
  588.  
  589. plrsforaim = {}
  590.  
  591. for i, plr in pairs(plrs:GetChildren()) do
  592.  
  593. if plr.Character and plr.Character.Humanoid and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name and plr.Character.Head then
  594.  
  595.  
  596.  
  597. if TeamBased == true then
  598.  
  599. if plr.Team.Name ~= lplr.Team.Name then
  600.  
  601. local cf = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, plr.Character.Head.CFrame.p)
  602.  
  603. local r = Ray.new(cf, cf.LookVector * 10000)
  604.  
  605. local ign = {}
  606.  
  607. for i, v in pairs(plrs.LocalPlayer.Character:GetChildren()) do
  608.  
  609. if v:IsA("BasePart") then
  610.  
  611. table.insert(ign , v)
  612.  
  613. end
  614.  
  615. end
  616.  
  617. local obj = game.Workspace:FindPartOnRayWithIgnoreList(r, ign)
  618.  
  619. if obj.Parent == plr.Character and obj.Parent ~= lplr.Character then
  620.  
  621. table.insert(plrsforaim, obj)
  622.  
  623. end
  624.  
  625. end
  626.  
  627. else
  628.  
  629. local cf = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, plr.Character.Head.CFrame.p)
  630.  
  631. local r = Ray.new(cf, cf.LookVector * 10000)
  632.  
  633. local ign = {}
  634.  
  635. for i, v in pairs(plrs.LocalPlayer.Character:GetChildren()) do
  636.  
  637. if v:IsA("BasePart") then
  638.  
  639. table.insert(ign , v)
  640.  
  641. end
  642.  
  643. end
  644.  
  645. local obj = game.Workspace:FindPartOnRayWithIgnoreList(r, ign)
  646.  
  647. if obj.Parent == plr.Character and obj.Parent ~= lplr.Character then
  648.  
  649. table.insert(plrsforaim, obj)
  650.  
  651. end
  652.  
  653. end
  654.  
  655.  
  656.  
  657.  
  658.  
  659. end
  660.  
  661. end
  662.  
  663. end
  664.  
  665.  
  666.  
  667. function aimat(part)
  668.  
  669. cam.CFrame = CFrame.new(cam.CFrame.p, part.CFrame.p)
  670.  
  671. end
  672.  
  673. function checkfov (part)
  674.  
  675. local fov = getfovxyz(game.Workspace.CurrentCamera.CFrame, part.CFrame)
  676.  
  677. local angle = math.abs(fov.X) + math.abs(fov.Y)
  678.  
  679. return angle
  680.  
  681. end
  682.  
  683.  
  684.  
  685. game:GetService("RunService").RenderStepped:Connect(function()
  686.  
  687. if aimatpart then
  688.  
  689. aimat(aimatpart)
  690.  
  691. if aimatpart.Parent == plrs.LocalPlayer.Character then
  692.  
  693. aimatpart = nil
  694.  
  695. end
  696.  
  697. end
  698.  
  699.  
  700.  
  701.  
  702.  
  703. -- if switch == true then
  704.  
  705. -- local maxangle = 99999
  706.  
  707. --
  708.  
  709. -- --print("Loop")
  710.  
  711. -- if true and raycast == false then
  712.  
  713. -- for i, plr in pairs(plrs:GetChildren()) do
  714.  
  715. -- if plr.Name ~= lplr.Name and plr.Character and plr.Character.Head and plr.Character.Humanoid and plr.Character.Humanoid.Health > 1 then
  716.  
  717. -- if TeamBased then
  718.  
  719. -- if plr.Team.Name ~= lplr.Team.Name or plr.Team.TeamColor ~= lplr.Team.TeamColor then
  720.  
  721. -- local an = checkfov(plr.Character.Head)
  722.  
  723. -- if an < maxangle then
  724.  
  725. -- maxangle = an
  726.  
  727. -- aimatpart = plr.Character.Head
  728.  
  729. -- if an < lockangle then
  730.  
  731. -- break
  732.  
  733. -- end
  734.  
  735. -- end
  736.  
  737. -- end
  738.  
  739. -- else
  740.  
  741. -- local an = checkfov(plr.Character.Head)
  742.  
  743. -- if an < maxangle then
  744.  
  745. -- maxangle = an
  746.  
  747. -- aimatpart = plr.Character.Head
  748.  
  749. -- if an < lockangle then
  750.  
  751. -- break
  752.  
  753. -- end
  754.  
  755. -- end
  756.  
  757. -- end
  758.  
  759. --
  760.  
  761. --
  762.  
  763. --
  764.  
  765. --
  766.  
  767. -- end
  768.  
  769. -- end
  770.  
  771. -- elseif raycast == true then
  772.  
  773. --
  774.  
  775. -- end
  776.  
  777.  
  778.  
  779. if raycast == true and switch == false and not aimatpart then
  780.  
  781. getaimbotplrs()
  782.  
  783. aimatpart = nil
  784.  
  785. local maxangle = 999
  786.  
  787. for i, v in ipairs(plrsforaim) do
  788.  
  789. if v.Parent ~= lplr.Character then
  790.  
  791. local an = checkfov(v)
  792.  
  793. if an < maxangle and v ~= lplr.Character.Head then
  794.  
  795. maxangle = an
  796.  
  797. aimatpart = v
  798.  
  799. print(v:GetFullName())
  800.  
  801. v.Parent.Humanoid.Died:connect(function()
  802.  
  803. aimatpart = nil
  804.  
  805. end)
  806.  
  807. end
  808.  
  809. end
  810.  
  811. end
  812.  
  813.  
  814.  
  815. end
  816.  
  817. end)
  818.  
  819. delay(0, function()
  820.  
  821. while wait(espupdatetime) do
  822.  
  823. if autoesp == true then
  824.  
  825. pcall(function()
  826.  
  827. f.addesp()
  828.  
  829. end)
  830.  
  831. end
  832.  
  833. end
  834.  
  835. end)
  836.  
  837. warn("loaded")
Add Comment
Please, Sign In to add comment