Advertisement
Darkwidow10

Bad business prototype Aimbot & ESP

Jun 30th, 2019
24,151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.24 KB | None | 0 0
  1. wait(1)
  2. --// SERVICES \\--
  3. local playerser = game:GetService("Players")
  4. local repstor = game:GetService("ReplicatedStorage")
  5. local repfirst = game:GetService("ReplicatedFirst")
  6. local inputser = game:GetService("UserInputService")
  7. local runser = game:GetService("RunService")
  8. local coregui = game:GetService("CoreGui")
  9. local tweenser = game:GetService("TweenService")
  10.  
  11. --// VARIABLES \\--
  12. local client = playerser.LocalPlayer
  13. local camera = workspace.CurrentCamera
  14. local playergui = client:WaitForChild("PlayerGui")
  15. playergui:SetTopbarTransparency(1)
  16. local mouse = client:GetMouse()
  17. local heartbeat = runser.Heartbeat
  18. local renderstep = runser.RenderStepped
  19.  
  20. --// LOCALS \\--
  21. local colors = {
  22. esp = Color3.fromRGB(255, 74, 74),
  23. esp_visible = Color3.fromRGB(66, 248, 63)
  24. }
  25. local aimbotting = false
  26. local sg = Instance.new("ScreenGui", coregui)
  27. local espFolder = Instance.new("Folder", sg)
  28.  
  29. local bodyParts = {
  30. ["Head"] = true,
  31. ["Chest"] = true,
  32. ["Abdomen"] = true,
  33. ["Hips"] = true,
  34. ["LeftUpperArm"] = true,
  35. ["RightUpperArm"] = true,
  36. ["RightLowerArm"] = true,
  37. ["LeftLowerArm"] = true,
  38. ["LeftHand"] = true,
  39. ["RightHand"] = true,
  40. ["LeftUpperLeg"] = true,
  41. ["RightUpperLeg"] = true,
  42. ["LeftLowerLeg"] = true,
  43. ["RightLowerLeg"] = true,
  44. ["LeftFoot"] = true,
  45. ["RightFoot"] = true
  46. }
  47. --// FUNCTIONS \\--
  48. local function createBox(player)
  49. local lines = Instance.new("Frame")
  50. lines.Name = player.Name
  51. lines.BackgroundTransparency = 1
  52. lines.AnchorPoint = Vector2.new(0.5,0.5)
  53.  
  54. local outlines = Instance.new("Folder", lines)
  55. outlines.Name = "outlines"
  56. local inlines = Instance.new("Folder", lines)
  57. inlines.Name = "inlines"
  58.  
  59. local outline1 = Instance.new("Frame", outlines)
  60. outline1.Name = "left"
  61. outline1.BorderSizePixel = 0
  62. outline1.BackgroundColor3 = Color3.new(0,0,0)
  63. outline1.Size = UDim2.new(0,-1,1,0)
  64.  
  65. local outline2 = Instance.new("Frame", outlines)
  66. outline2.Name = "right"
  67. outline2.BorderSizePixel = 0
  68. outline2.BackgroundColor3 = Color3.new(0,0,0)
  69. outline2.Position = UDim2.new(1,0,0,0)
  70. outline2.Size = UDim2.new(0,1,1,0)
  71.  
  72. local outline3 = Instance.new("Frame", outlines)
  73. outline3.Name = "up"
  74. outline3.BorderSizePixel = 0
  75. outline3.BackgroundColor3 = Color3.new(0,0,0)
  76. outline3.Size = UDim2.new(1,0,0,-1)
  77.  
  78. local outline4 = Instance.new("Frame", outlines)
  79. outline4.Name = "down"
  80. outline4.BorderSizePixel = 0
  81. outline4.BackgroundColor3 = Color3.new(0,0,0)
  82. outline4.Position = UDim2.new(0,0,1,0)
  83. outline4.Size = UDim2.new(1,0,0,1)
  84.  
  85. local inline1 = Instance.new("Frame", inlines)
  86. inline1.Name = "left"
  87. inline1.BorderSizePixel = 0
  88. inline1.Size = UDim2.new(0,1,1,0)
  89.  
  90. local inline2 = Instance.new("Frame", inlines)
  91. inline2.Name = "right"
  92. inline2.BorderSizePixel = 0
  93. inline2.Position = UDim2.new(1,0,0,0)
  94. inline2.Size = UDim2.new(0,-1,1,0)
  95.  
  96. local inline3 = Instance.new("Frame", inlines)
  97. inline3.Name = "up"
  98. inline3.BorderSizePixel = 0
  99. inline3.Size = UDim2.new(1,0,0,1)
  100.  
  101. local inline4 = Instance.new("Frame", inlines)
  102. inline4.Name = "down"
  103. inline4.BorderSizePixel = 0
  104. inline4.Position = UDim2.new(0,0,1,0)
  105. inline4.Size = UDim2.new(1,0,0,-1)
  106.  
  107. local text = Instance.new("TextLabel", lines)
  108. text.Name = "nametag"
  109. text.Position = UDim2.new(0.5,0,0,-12)
  110. text.Size = UDim2.new(0,100,0,-20)
  111. text.AnchorPoint = Vector2.new(0.5,0.5)
  112. text.BackgroundTransparency = 1
  113. text.Text = player.Name
  114. text.Font = Enum.Font.Code
  115. text.TextSize = 14
  116. text.TextStrokeTransparency = 0
  117.  
  118. return lines
  119. end
  120.  
  121. local function updateEsp(player, box)
  122. runser:BindToRenderStep(player.Name.."'s esp", 1, function()
  123. local clientchar = workspace.Characters:FindFirstChild(client.Name)
  124. local xMin = camera.ViewportSize.X
  125. local yMin = camera.ViewportSize.Y
  126. local xMax = 0
  127. local yMax = 0
  128. if player and player:FindFirstChild"Body" and player.Body:FindFirstChild"Head" then
  129. local screenPos, vis = camera:WorldToScreenPoint(player.PrimaryPart.Position)
  130. local nameTagPos = camera:WorldToScreenPoint(player.Body.Head.Position)
  131. if vis then
  132. box.Visible = true
  133. local function getCorners(obj, size)
  134. local corners = {
  135. Vector3.new(obj.X+size.X/2, obj.Y+size.Y/2, obj.Z+size.Z/2);
  136. Vector3.new(obj.X-size.X/2, obj.Y+size.Y/2, obj.Z+size.Z/2);
  137.  
  138. Vector3.new(obj.X-size.X/2, obj.Y-size.Y/2, obj.Z-size.Z/2);
  139. Vector3.new(obj.X+size.X/2, obj.Y-size.Y/2, obj.Z-size.Z/2);
  140.  
  141. Vector3.new(obj.X-size.X/2, obj.Y+size.Y/2, obj.Z-size.Z/2);
  142. Vector3.new(obj.X+size.X/2, obj.Y+size.Y/2, obj.Z-size.Z/2);
  143.  
  144. Vector3.new(obj.X-size.X/2, obj.Y-size.Y/2, obj.Z+size.Z/2);
  145. Vector3.new(obj.X+size.X/2, obj.Y-size.Y/2, obj.Z+size.Z/2);
  146. }
  147. return corners
  148. end
  149. local i = 1
  150. local allCorners = {}
  151. for _,v in pairs(player.Body:GetChildren()) do
  152. if bodyParts[v.Name] then
  153. local a = getCorners(v.CFrame, v.Size)
  154. for _,v in pairs(a) do
  155. table.insert(allCorners, i, v)
  156. i = i + 1
  157. end
  158. end
  159. end
  160. for i,v in pairs(allCorners) do
  161. local pos = camera:WorldToScreenPoint(v)
  162. if pos.X > xMax then
  163. xMax = pos.X
  164. end
  165. if pos.X < xMin then
  166. xMin = pos.X
  167. end
  168. if pos.Y > yMax then
  169. yMax = pos.Y
  170. end
  171. if pos.Y < yMin then
  172. yMin = pos.Y
  173. end
  174. end
  175. local xSize = xMax - xMin
  176. local ySize = yMax - yMin
  177. box.Position = UDim2.new(0,xMin+(Vector2.new(xMax,0)-Vector2.new(xMin,0)).magnitude/2,0,yMin+(Vector2.new(0,yMax)-Vector2.new(0,yMin)).magnitude/2)
  178. box.Size = UDim2.new(0,xSize,0,ySize)
  179.  
  180. local ignore = {clientchar, camera, workspace:FindFirstChild"Arms"}
  181. for _,v in pairs(workspace:GetChildren()) do
  182. if v:IsA"Model" and v.Name ~= "Arms" then
  183. table.insert(ignore, 4, v)
  184. end
  185. end
  186. local ray = Ray.new(camera.CFrame.p, (player.Body.Head.Position-camera.CFrame.p).unit*1000)
  187. local hit, pos = workspace:FindPartOnRayWithIgnoreList(ray, ignore, false, false)
  188. local suffix
  189. if hit and hit:FindFirstAncestor(player.Name) then
  190. suffix = "_visible"
  191. else
  192. suffix = ""
  193. end
  194. for _,v in pairs(box.inlines:GetChildren()) do
  195. v.BackgroundColor3 = colors["esp"..suffix]
  196. end
  197. box.nametag.TextColor3 = colors["esp"..suffix]
  198. else
  199. box.Visible = false
  200. end
  201. else
  202. box.Visible = false
  203. end
  204. end)
  205. end
  206.  
  207. local function checkTeam(player, caller)
  208. local omegaTeam = game.Teams.Omega.Players
  209. local betaTeam = game.Teams.Beta.Players
  210. local myTeam
  211. if omegaTeam:FindFirstChild(client.Name) then
  212. myTeam = "Omega"
  213. elseif betaTeam:FindFirstChild(client.Name) then
  214. myTeam = "Beta"
  215. end
  216. local enemyTeam
  217. if omegaTeam:FindFirstChild(player.Name) then
  218. enemyTeam = "Omega"
  219. elseif betaTeam:FindFirstChild(player.Name) then
  220. enemyTeam = "Beta"
  221. end
  222. if enemyTeam ~= myTeam then
  223. if caller == "esp" then
  224. local box = createBox(player)
  225. updateEsp(player, box)
  226. box.Parent = espFolder
  227. end
  228. return true
  229. else
  230. return false
  231. end
  232. end
  233.  
  234. function updateAim()
  235. if aimbotting then
  236. if workspace.Characters:FindFirstChild(client.Name) then
  237. local clientchar = workspace.Characters:FindFirstChild(client.Name)
  238. for _,player in pairs(workspace.Characters:GetChildren()) do
  239. if checkTeam(player, "aimbot") and player:FindFirstChild"Body" and player.Body:FindFirstChild"Head" then
  240. local ignore = {clientchar, camera, workspace:FindFirstChild"Arms"}
  241. for _,v in pairs(workspace:GetChildren()) do
  242. if v:IsA"Model" and v.Name ~= "Arms" then
  243. table.insert(ignore, 4, v)
  244. end
  245. end
  246. local ray = Ray.new(camera.CFrame.p, (player.Body.Head.Position-camera.CFrame.p).unit*1000)
  247. local hit, pos = workspace:FindPartOnRayWithIgnoreList(ray, ignore, false, false)
  248. local screenPos, vis = camera:WorldToScreenPoint(player.Body.Head.Position)
  249. if vis and hit and hit:FindFirstAncestor(player.Name) then
  250. camera.CFrame = CFrame.new(camera.CFrame.p, player.Body.Head.Position)
  251. end
  252. end
  253. end
  254. end
  255. end
  256. end
  257.  
  258. inputser.InputBegan:connect(function(input, gamep)
  259. if not gamep then
  260. if input.UserInputType == Enum.UserInputType.MouseButton2 then
  261. aimbotting = true
  262. end
  263. end
  264. end)
  265.  
  266. inputser.InputEnded:connect(function(input, gamep)
  267. if not gamep then
  268. if input.UserInputType == Enum.UserInputType.MouseButton2 then
  269. aimbotting = false
  270. end
  271. end
  272. end)
  273.  
  274. for _,player in pairs(workspace.Characters:GetChildren()) do
  275. checkTeam(player, "esp")
  276. end
  277.  
  278. workspace.Characters.ChildAdded:connect(function(player)
  279. checkTeam(player, "esp")
  280. end)
  281.  
  282. workspace.Characters.ChildRemoved:connect(function(player)
  283. runser:UnbindFromRenderStep(player.Name.."'s esp")
  284. if espFolder:FindFirstChild(player.Name) then
  285. espFolder[player.Name]:Destroy()
  286. end
  287. end)
  288. runser:BindToRenderStep("aimbot", 2, updateAim)
  289.  
  290. getrenv().warn"made by Jan#5106 eat my ass"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement