Advertisement
Guest User

Untitled

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