Advertisement
Nova355killer

Aimbot

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