Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.85 KB | None | 0 0
  1. --dont leak bruh or bad buz devs will patch ; made by fireztron
  2.  
  3. local plrs = game:GetService("Players")
  4. local TeamBased = true ; local teambasedswitch = "o"
  5. local presskeytoaim = true; local aimkey = "e"
  6. local lockaim = true; local lockangle = 5
  7. local CharactersFolder = workspace:WaitForChild('Characters')
  8. local DeltaSens = game:GetService('UserInputService').MouseDeltaSensitivity
  9. -- Scripts:
  10. local enemyColor = Color3.fromRGB(255,0,0)
  11. local teamColor = Color3.fromRGB(50,205,50)
  12. local targetPlayer = ""
  13. local targetPlayerColor = Color3.fromRGB(255,255,255)
  14.  
  15.  
  16.  
  17. local lplr = game:GetService("Players").LocalPlayer
  18. local ScreenGui = Instance.new("ScreenGui",game:GetService('Players').LocalPlayer.PlayerGui)
  19. local ESPLocation = Instance.new("Folder",ScreenGui)
  20. local CharactersFolder = workspace:WaitForChild('Characters')
  21. local debounce = true
  22. local windowFocused = false
  23.  
  24. local Targets = {
  25. "Head",
  26. }
  27.  
  28. function espPart(part,player,color)
  29. local sides = {"Front","Back","Bottom","Left","Right","Top"}
  30. local Folder = Instance.new("Folder")
  31. Folder.Name = "ESPFolder"
  32. Folder.Parent = part
  33. local espColor = color
  34. if player.Name == targetPlayer then
  35. espColor = targetPlayerColor
  36. end
  37. for _,side in pairs(sides) do
  38. local surfacegui = Instance.new("SurfaceGui")
  39. surfacegui.Face = side
  40. surfacegui.Adornee = part
  41. surfacegui.Parent = Folder
  42. surfacegui.LightInfluence = 0
  43. surfacegui.AlwaysOnTop = true
  44. local frame = Instance.new("Frame")
  45. frame.Parent = surfacegui
  46. frame.Size = UDim2.new(1,0,1,0)
  47. frame.BorderSizePixel = 0
  48. frame.BackgroundColor3 = espColor or Color3.fromRGB(255,182,193)
  49. end
  50. local fart; local farted
  51. fart = CharactersFolder.ChildAdded:Connect(function(instance)
  52. if instance.Name == player.Name then
  53. Folder:Destroy()
  54. fart:Disconnect()
  55. end
  56. end)
  57. farted = CharactersFolder.ChildRemoved:Connect(function(instance)
  58. if instance.Name == player.Name then
  59. Folder:Destroy()
  60. farted:Disconnect()
  61. end
  62. end)
  63. end
  64.  
  65. function espPlayer(targetPlayer)
  66. if CharactersFolder:FindFirstChild(targetPlayer.Name) ~= nil then
  67. for _,part in pairs(CharactersFolder:FindFirstChild(targetPlayer.Name).Hitbox:GetChildren())do
  68. if part:IsA("BasePart") and part.Name ~= "Head" and part.Name ~= "RightFoot" and game:GetService('Players').LocalPlayer.Name ~= part.Parent.Name then
  69. if game:GetService('Teams'):FindFirstChild(targetPlayer.Name, true).Parent == game:GetService('Teams'):FindFirstChild(lplr.Name, true).Parent then
  70. debounce = false
  71. espPart(part,targetPlayer,teamColor)
  72. end
  73. if debounce == true then
  74. espPart(part,targetPlayer,enemyColor)
  75. end
  76. end
  77. end
  78. debounce = true
  79. end
  80. end
  81.  
  82. function ESP()
  83. ESPLocation:ClearAllChildren()
  84. for _,player in pairs(game:GetService('Players'):GetPlayers())do
  85. if player ~= game:GetService('Players').LocalPlayer then
  86. espPlayer(player)
  87. end
  88. end
  89. end
  90.  
  91.  
  92. local function WaitUntilCharacterLoaded(Char)
  93. for _,Part in pairs(Targets)do
  94. Char:WaitForChild(Part)
  95. end
  96. end
  97.  
  98. CharactersFolder.ChildAdded:Connect(function(instance)
  99. if instance.Name ~= game:GetService('Players').LocalPlayer.Name then
  100. WaitUntilCharacterLoaded(instance:WaitForChild('Hitbox'))
  101. espPlayer(game:GetService('Players')[instance.Name])
  102. end
  103. end)
  104.  
  105.  
  106.  
  107. ESP()
  108.  
  109. local plrsforaim = {}
  110.  
  111.  
  112. local CF = CFrame.new
  113.  
  114.  
  115. local cam = workspace.CurrentCamera
  116.  
  117. local mouse = lplr:GetMouse()
  118. local aimatpart = nil
  119.  
  120.  
  121. function checkDistance(part)
  122.  
  123. for i,v in pairs(game.Players:GetPlayers())do
  124. if v and v.Parent.Parent.Name ~= lplr.Name then
  125. local distance = (workspace.Characters[lplr.Name].Hitbox.Head.Position - part.Position).Magnitude
  126. return distance
  127. end
  128. end
  129. end
  130.  
  131. game:GetService('UserInputService').InputBegan:Connect(function(input)
  132. if input.UserInputType == Enum.UserInputType.MouseButton2 then
  133. if not aimatpart then
  134. local maxangle = math.rad(20)
  135. local lowestdistance = math.huge -- infinity
  136. local NearestPlayer
  137. for i, plr in pairs(plrs:GetChildren()) do
  138. local CharModel = CharactersFolder:FindFirstChild(plr.Name)
  139. if CharModel ~= nil then
  140. if plr.Name ~= lplr.Name and CharactersFolder:FindFirstChild(plr.Name) and CharactersFolder[plr.Name].Health.Value > 1 and CharactersFolder[lplr.Name].Health.Value > 1 then
  141. if TeamBased == true then
  142. if game:GetService('Teams'):FindFirstChild(plr.Name, true).Parent ~= game:GetService('Teams'):FindFirstChild(lplr.Name, true).Parent then
  143. local an = checkfov(CharactersFolder[plr.Name].Hitbox.Head)
  144. local dist = checkDistance(CharactersFolder[plr.Name].Hitbox.Head)
  145. if an < maxangle and dist < lowestdistance then
  146. lowestdistance = dist
  147. maxangle = an
  148. aimatpart = CharactersFolder[plr.Name].Hitbox.Head
  149. end
  150. end
  151. else
  152.  
  153. local an = checkfov(CharactersFolder[plr.Name].Hitbox.Head)
  154. local dist = checkDistance(CharactersFolder[plr.Name].Hitbox.Head)
  155. if an < maxangle and dist < lowestdistance then
  156. lowestdistance = dist
  157. maxangle = an
  158. aimatpart = CharactersFolder[plr.Name].Hitbox.Head
  159. break
  160. end
  161. end
  162. end
  163. end
  164. end
  165. end
  166. end
  167. end)
  168.  
  169. game:GetService('UserInputService').InputEnded:Connect(function(input)
  170. if input.UserInputType == Enum.UserInputType.MouseButton2 then
  171. aimatpart = nil
  172. end
  173. end)
  174.  
  175.  
  176. function getfovxyz (p0, p1, deg)
  177. local x1, y1, z1 = p0:ToOrientation()
  178. local cf = CFrame.new(p0.p, p1.p)
  179. local x2, y2, z2 = cf:ToOrientation()
  180. --local d = math.deg
  181. if deg then
  182. --return Vector3.new(d(x1-x2), d(y1-y2), d(z1-z2))
  183. else
  184. return Vector3.new((x1-x2), (y1-y2), (z1-z2))
  185. end
  186. end
  187.  
  188. function getaimbotplrs()
  189. plrsforaim = {}
  190. for i, plr in pairs(plrs:GetChildren()) do
  191. local CharModel = CharactersFolder:FindFirstChild(plr.Name)
  192. if CharModel ~= nil then
  193. if CharactersFolder[plr.Name].Hitbox and CharactersFolder[plr.Name].Hitbox.Humanoid and CharactersFolder[plr.Name].Health.Value > 0 and plr.Name ~= lplr.Name and CharactersFolder[plr.Name].Hitbox.Head then
  194.  
  195. if TeamBased == true then
  196. if game:GetService('Teams'):FindFirstChild(plr.Name, true).Parent ~= game:GetService('Teams'):FindFirstChild(lplr.Name, true).Parent then
  197. local cf = CFrame.new(workspace.CurrentCamera.CFrame.p, CharactersFolder[plr.Name].Hitbox.Head.CFrame.p)
  198. local r = Ray.new(cf, cf.LookVector * 10000)
  199. local ign = {}
  200. for i, v in pairs(CharactersFolder[lplr.Name].Hitbox:GetChildren()) do
  201. if v:IsA("BasePart") then
  202. table.insert(ign , v)
  203. end
  204. end
  205. local obj = workspace:FindPartOnRayWithIgnoreList(r, ign)
  206. if obj.Parent == CharactersFolder[plr.Name].Hitbox and obj.Parent ~= CharactersFolder[lplr.Name].Hitbox then
  207. table.insert(plrsforaim, obj)
  208. end
  209. end
  210. else
  211. local cf = CFrame.new(workspace.CurrentCamera.CFrame.p, CharactersFolder[plr.Name].Hitbox.Head.CFrame.p)
  212. local r = Ray.new(cf, cf.LookVector * 10000)
  213. local ign = {}
  214. for i, v in pairs(CharactersFolder[lplr.Name].Hitbox:GetChildren()) do
  215. if v:IsA("BasePart") then
  216. table.insert(ign , v)
  217. end
  218. end
  219. local obj = workspace:FindPartOnRayWithIgnoreList(r, ign)
  220. if obj.Parent == CharactersFolder[plr.Name].Hitbox and obj.Parent ~= CharactersFolder[lplr.Name].Hitbox then
  221. table.insert(plrsforaim, obj)
  222. end
  223. end
  224.  
  225.  
  226. end
  227. end
  228. end
  229. end
  230.  
  231. function aimat(part)
  232. local MouseLocation = game:GetService('UserInputService'):GetMouseLocation()
  233. local ScreenPoint = cam:WorldToViewportPoint(part.Position)
  234. local MousePos = Vector2.new(ScreenPoint.X, ScreenPoint.Y) - MouseLocation
  235. local MoveMouse = mousemoverel or game:GetService('UserInputService').MoveMouse
  236. MoveMouse(MousePos.X, MousePos.Y-5)
  237.  
  238. end
  239. function checkfov (part)
  240. local fov = getfovxyz(workspace.CurrentCamera.CFrame, part.CFrame)
  241. local angle = math.abs(fov.X) + math.abs(fov.Y)
  242. return angle
  243. end
  244.  
  245. game:GetService('RunService').RenderStepped:Connect(function(step)
  246. if windowFocused == true then
  247. if aimatpart and CharactersFolder:FindFirstChild(lplr.Name) then
  248. game:GetService('UserInputService').MouseDeltaSensitivity = .4
  249. aimat(aimatpart)
  250. if aimatpart.Parent == CharactersFolder[lplr.Name].Hitbox then
  251. aimatpart = nil
  252. end
  253. else
  254. game:GetService('UserInputService').MouseDeltaSensitivity = DeltaSens
  255. end
  256. end
  257. end)
  258.  
  259. game:GetService('UserInputService').WindowFocusReleased:Connect(function()
  260. windowFocused = false
  261. end)
  262.  
  263. game:GetService('UserInputService').WindowFocused:Connect(function()
  264. windowFocused = true
  265. end)
  266. warn("loaded")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement