Advertisement
ThotScripter

Arsenal Gui

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