Advertisement
Guest User

123456

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