Advertisement
Faqz

Aspect Aimbot

Jul 26th, 2021
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.63 KB | None | 0 0
  1. -- Aimbot By Faqz#9136
  2.  
  3. local plrs = game:GetService("Players")
  4. local TeamBased = true ; local teambasedswitch = "o"
  5. local presskeytoaim = true; local aimkey = "e"
  6. local raycast = false
  7.  
  8. local espupdatetime = 5; autoesp = false
  9.  
  10.  
  11.  
  12. local lockaim = true; local lockangle = 5
  13.  
  14.  
  15.  
  16. --function findwat(folder, what)
  17. -- for i, smth in pairs(folder:GetChildren()) do
  18. -- if string.find(string.lower(tostring(smth)), string.lower(what)) then
  19. -- return smth
  20. -- end
  21. -- end
  22. --end
  23. --
  24. --local plrs = findwat(game, "Players")
  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. Gui.Name = "Gui"
  39. Gui.Parent = plrs.LocalPlayer:WaitForChild("PlayerGui")
  40.  
  41. Move.Name = "Move"
  42. Move.Parent = Gui
  43. Move.BackgroundColor3 = Color3.new(0.0431373, 1, 0.0745098)
  44. Move.BackgroundTransparency = 0.40000000596046
  45. Move.BorderSizePixel = 0
  46. Move.Position = UDim2.new(0.005, 0,0.018, 0)
  47. Move.Size = UDim2.new(0.28141585, 0, 0.0320388414, 0)
  48. Move.Visible = false
  49.  
  50. Main.Name = "Main"
  51. Main.Parent = Move
  52. Main.BackgroundColor3 = Color3.new(0.176471, 0.176471, 0.176471)
  53. Main.BackgroundTransparency = 0.69999998807907
  54. Main.Position = UDim2.new(0, 0, 0.995670795, 0)
  55. Main.Size = UDim2.new(1.0000006, 0, 9.79697132, 0)
  56. Main.Visible = false
  57.  
  58. EspStatus.Name = "EspStatus"
  59. EspStatus.Parent = Main
  60. EspStatus.BackgroundColor3 = Color3.new(1, 1, 1)
  61. EspStatus.BackgroundTransparency = 1
  62. EspStatus.Size = UDim2.new(0.272955924, 0, 0.161862016, 0)
  63. EspStatus.Font = Enum.Font.ArialBold
  64. EspStatus.Text = "Press T to update Esp"
  65. EspStatus.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  66. EspStatus.TextScaled = true
  67. EspStatus.TextSize = 14
  68. EspStatus.TextWrapped = true
  69.  
  70. st1.Name = "st1"
  71. st1.Parent = Main
  72. st1.BackgroundColor3 = Color3.new(1, 1, 1)
  73. st1.BackgroundTransparency = 1
  74. st1.Position = UDim2.new(0.271787882, 0, 0, 0)
  75. st1.Size = UDim2.new(0.728211343, 0, 0.161862016, 0)
  76. st1.Font = Enum.Font.ArialBold
  77. st1.Text = "Press "..aimkey.." to lock on a person inside ur view"
  78. st1.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  79. st1.TextScaled = true
  80. st1.TextSize = 14
  81. st1.TextWrapped = true
  82.  
  83. st1_2.Name = "st1"
  84. st1_2.Parent = Main
  85. st1_2.BackgroundColor3 = Color3.new(1, 1, 1)
  86. st1_2.BackgroundTransparency = 1
  87. st1_2.Position = UDim2.new(0, 0, 0.375590861, 0)
  88. st1_2.Size = UDim2.new(0.999999881, 0, 0.161862016, 0)
  89. st1_2.Font = Enum.Font.ArialBold
  90. st1_2.Text = "Press L to enable esp loop"
  91. st1_2.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  92. st1_2.TextScaled = true
  93. st1_2.TextSize = 14
  94. st1_2.TextWrapped = true
  95.  
  96. st1_3.Name = "st1"
  97. st1_3.Parent = Main
  98. st1_3.BackgroundColor3 = Color3.new(1, 1, 1)
  99. st1_3.BackgroundTransparency = 1
  100. st1_3.Position = UDim2.new(0, 0, 0.18558608, 0)
  101. st1_3.Size = UDim2.new(0.999999881, 0, 0.161862016, 0)
  102. st1_3.Font = Enum.Font.ArialBold
  103. st1_3.Text = "Press O to change team based mode"
  104. st1_3.TextColor3 = Color3.new(0.0431373, 1, 0.0745098)
  105. st1_3.TextScaled = true
  106. st1_3.TextSize = 14
  107. st1_3.TextWrapped = true
  108. local teambasedstatus = st1_3:Clone()
  109. teambasedstatus.Parent = st1_3
  110. teambasedstatus.TextScaled = true
  111. teambasedstatus.Position = UDim2.new(0, 0,0.694, 0)
  112. teambasedstatus.Text = tostring(TeamBased)
  113.  
  114. Name.Name = "Name"
  115. Name.Parent = Move
  116. Name.BackgroundColor3 = Color3.new(1, 1, 1)
  117. Name.BackgroundTransparency = 1
  118. Name.Size = UDim2.new(0.838, 0, 0.980000019, 0)
  119. Name.Visible = false
  120. Name.Font = Enum.Font.Arial
  121. Name.Text = "FPS gui v1.0"
  122. Name.TextColor3 = Color3.new(0, 0, 0)
  123. Name.TextScaled = true
  124. Name.TextSize = 14
  125. Name.TextWrapped = true
  126. Name.TextXAlignment = Enum.TextXAlignment.Left
  127. -- Scripts:
  128.  
  129.  
  130. local plrsforaim = {}
  131.  
  132. local lplr = game:GetService("Players").LocalPlayer
  133. Move.Draggable = true
  134. Gui.ResetOnSpawn = false
  135. Gui.Name = "Chat"
  136. Gui.DisplayOrder = 999
  137.  
  138. Gui.Parent = plrs.LocalPlayer.PlayerGui
  139.  
  140.  
  141. f = {}
  142. local espforlder
  143.  
  144. f.addesp = function()
  145. --print("ESP ran")
  146. if espforlder then
  147. else
  148. espforlder = Instance.new("Folder")
  149. espforlder.Parent = game.Workspace.CurrentCamera
  150. end
  151. for i, v in pairs(espforlder:GetChildren()) do
  152. v:Destroy()
  153. end
  154. for _, plr in pairs(plrs:GetChildren()) do
  155. if plr.Character and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name then
  156. if TeamBased == true then
  157. if plr.Team.Name ~= plrs.LocalPlayer.Team.Name then
  158. local e = espforlder:FindFirstChild(plr.Name)
  159. if not e then
  160. --print("Added esp for team based")
  161. local bill = Instance.new("BillboardGui", espforlder)
  162. bill.Name = plr.Name
  163. bill.AlwaysOnTop = true
  164. bill.Size = UDim2.new(1,0,1,0)
  165. bill.Adornee = plr.Character.Head
  166. local Frame = Instance.new('Frame',bill)
  167. Frame.Active = true
  168. Frame.BackgroundColor3 = Color3.new(0/255,255/255,0/255)
  169. Frame.BackgroundTransparency = 0
  170. Frame.BorderSizePixel = 0
  171. Frame.AnchorPoint = Vector2.new(.5, .5)
  172. Frame.Position = UDim2.new (0.5,0,0.5,0)
  173. Frame.Size = UDim2.new (1,0,1,0)
  174. Frame.Rotation = 0
  175. plr.Character.Humanoid.Died:Connect(function()
  176. bill:Destroy()
  177. end)
  178. end
  179. end
  180. else
  181. local e = espforlder:FindFirstChild(plr.Name)
  182. if not e then
  183. --print("Added esp")
  184. local bill = Instance.new("BillboardGui", espforlder)
  185. bill.Name = plr.Name
  186. bill.AlwaysOnTop = true
  187. bill.Size = UDim2.new(1,0,1,0)
  188. bill.Adornee = plr.Character.Head
  189. local Frame = Instance.new('Frame',bill)
  190. Frame.Active = true
  191. Frame.BackgroundColor3 = Color3.new(35,35,35)
  192. Frame.BackgroundTransparency = 0
  193. Frame.BorderSizePixel = 0
  194. Frame.AnchorPoint = Vector2.new(.5, .5)
  195. Frame.Position = UDim2.new (0.5,0,0.5,0)
  196. Frame.Size = UDim2.new (1,0,1,0)
  197. Frame.Rotation = 0
  198. plr.Character.Humanoid.Died:Connect(function()
  199. bill:Destroy()
  200. end)
  201. end
  202. end
  203.  
  204.  
  205. end
  206. end
  207. end
  208. local cam = game.Workspace.CurrentCamera
  209.  
  210. local mouse = lplr:GetMouse()
  211. local switch = false
  212. local key = "k"
  213. local aimatpart = nil
  214. mouse.KeyDown:Connect(function(a)
  215. if a == "t" then
  216. print("worked1")
  217. f.addesp()
  218. elseif a == "u" then
  219. if raycast == true then
  220. raycast = false
  221. else
  222. raycast = true
  223. end
  224. elseif a == "l" then
  225. if autoesp == false then
  226. autoesp = true
  227. else
  228. autoesp = false
  229. end
  230. end
  231. if a == "j" then
  232. if mouse.Target then
  233. mouse.Target:Destroy()
  234. end
  235. end
  236. if a == key then
  237. if switch == false then
  238. switch = true
  239. else
  240. switch = false
  241. if aimatpart ~= nil then
  242. aimatpart = nil
  243. end
  244. end
  245. elseif a == teambasedswitch then
  246. if TeamBased == true then
  247. TeamBased = false
  248. teambasedstatus.Text = tostring(TeamBased)
  249. else
  250. TeamBased = true
  251. teambasedstatus.Text = tostring(TeamBased)
  252. end
  253. elseif a == aimkey then
  254. if not aimatpart then
  255. local maxangle = math.rad(20)
  256. for i, plr in pairs(plrs:GetChildren()) do
  257. if plr.Name ~= lplr.Name and plr.Character and plr.Character.Head and plr.Character.Humanoid and plr.Character.Humanoid.Health > 1 then
  258. if TeamBased == true then
  259. if plr.Team.Name ~= lplr.Team.Name then
  260. local an = checkfov(plr.Character.Head)
  261. if an < maxangle then
  262. maxangle = an
  263. aimatpart = plr.Character.Head
  264. end
  265. end
  266. else
  267. local an = checkfov(plr.Character.Head)
  268. if an < maxangle then
  269. maxangle = an
  270. aimatpart = plr.Character.Head
  271. end
  272. print(plr)
  273. end
  274. plr.Character.Humanoid.Died:Connect(function()
  275. if aimatpart.Parent == plr.Character or aimatpart == nil then
  276. aimatpart = nil
  277. end
  278. end)
  279. end
  280. end
  281. else
  282. aimatpart = nil
  283. end
  284. end
  285. end)
  286.  
  287. function getfovxyz (p0, p1, deg)
  288. local x1, y1, z1 = p0:ToOrientation()
  289. local cf = CFrame.new(p0.p, p1.p)
  290. local x2, y2, z2 = cf:ToOrientation()
  291. --local d = math.deg
  292. if deg then
  293. --return Vector3.new(d(x1-x2), d(y1-y2), d(z1-z2))
  294. else
  295. return Vector3.new((x1-x2), (y1-y2), (z1-z2))
  296. end
  297. end
  298.  
  299. function getaimbotplrs()
  300. plrsforaim = {}
  301. for i, plr in pairs(plrs:GetChildren()) do
  302. if plr.Character and plr.Character.Humanoid and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name and plr.Character.Head then
  303.  
  304. if TeamBased == true then
  305. if plr.Team.Name ~= lplr.Team.Name then
  306. local cf = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, plr.Character.Head.CFrame.p)
  307. local r = Ray.new(cf, cf.LookVector * 10000)
  308. local ign = {}
  309. for i, v in pairs(plrs.LocalPlayer.Character:GetChildren()) do
  310. if v:IsA("BasePart") then
  311. table.insert(ign , v)
  312. end
  313. end
  314. local obj = game.Workspace:FindPartOnRayWithIgnoreList(r, ign)
  315. if obj.Parent == plr.Character and obj.Parent ~= lplr.Character then
  316. table.insert(plrsforaim, obj)
  317. end
  318. end
  319. else
  320. local cf = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, plr.Character.Head.CFrame.p)
  321. local r = Ray.new(cf, cf.LookVector * 10000)
  322. local ign = {}
  323. for i, v in pairs(plrs.LocalPlayer.Character:GetChildren()) do
  324. if v:IsA("BasePart") then
  325. table.insert(ign , v)
  326. end
  327. end
  328. local obj = game.Workspace:FindPartOnRayWithIgnoreList(r, ign)
  329. if obj.Parent == plr.Character and obj.Parent ~= lplr.Character then
  330. table.insert(plrsforaim, obj)
  331. end
  332. end
  333.  
  334.  
  335. end
  336. end
  337. end
  338.  
  339. function aimat(part)
  340. cam.CFrame = CFrame.new(cam.CFrame.p, part.CFrame.p)
  341. end
  342. function checkfov (part)
  343. local fov = getfovxyz(game.Workspace.CurrentCamera.CFrame, part.CFrame)
  344. local angle = math.abs(fov.X) + math.abs(fov.Y)
  345. return angle
  346. end
  347.  
  348. game:GetService("RunService").RenderStepped:Connect(function()
  349. if aimatpart then
  350. aimat(aimatpart)
  351. if aimatpart.Parent == plrs.LocalPlayer.Character then
  352. aimatpart = nil
  353. end
  354. end
  355.  
  356.  
  357. -- if switch == true then
  358. -- local maxangle = 99999
  359. --
  360. -- --print("Loop")
  361. -- if true and raycast == false then
  362. -- for i, plr in pairs(plrs:GetChildren()) do
  363. -- if plr.Name ~= lplr.Name and plr.Character and plr.Character.Head and plr.Character.Humanoid and plr.Character.Humanoid.Health > 1 then
  364. -- if TeamBased then
  365. -- if plr.Team.Name ~= lplr.Team.Name or plr.Team.TeamColor ~= lplr.Team.TeamColor then
  366. -- local an = checkfov(plr.Character.Head)
  367. -- if an < maxangle then
  368. -- maxangle = an
  369. -- aimatpart = plr.Character.Head
  370. -- if an < lockangle then
  371. -- break
  372. -- end
  373. -- end
  374. -- end
  375. -- else
  376. -- local an = checkfov(plr.Character.Head)
  377. -- if an < maxangle then
  378. -- maxangle = an
  379. -- aimatpart = plr.Character.Head
  380. -- if an < lockangle then
  381. -- break
  382. -- end
  383. -- end
  384. -- end
  385. --
  386. --
  387. --
  388. --
  389. -- end
  390. -- end
  391. -- elseif raycast == true then
  392. --
  393. -- end
  394.  
  395. if raycast == true and switch == false and not aimatpart then
  396. getaimbotplrs()
  397. aimatpart = nil
  398. local maxangle = 999
  399. for i, v in ipairs(plrsforaim) do
  400. if v.Parent ~= lplr.Character then
  401. local an = checkfov(v)
  402. if an < maxangle and v ~= lplr.Character.Head then
  403. maxangle = an
  404. aimatpart = v
  405. print(v:GetFullName())
  406. v.Parent.Humanoid.Died:connect(function()
  407. aimatpart = nil
  408. end)
  409. end
  410. end
  411. end
  412.  
  413. end
  414. end)
  415. delay(0, function()
  416. while wait(espupdatetime) do
  417. if autoesp == true then
  418. pcall(function()
  419. f.addesp()
  420. end)
  421. end
  422. end
  423. end)
  424. warn("loaded")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement