Syrimzz

Da Hood ESP

Feb 23rd, 2023
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.51 KB | None | 0 0
  1. --[Main Variables]
  2.  
  3. local plrs = game["Players"]
  4. local rs = game["RunService"]
  5. local Players = game:GetService("Players")
  6. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  7. local UserInputService = game:GetService("UserInputService")
  8. local Lighting = game:GetService("Lighting")
  9. local Teams = game:GetService("Teams")
  10. local RunService = game:GetService("RunService")
  11. local TeleportService = game:GetService("TeleportService")
  12.  
  13.  
  14. local LocalPlayer = Players.LocalPlayer
  15. local Mouse = LocalPlayer:GetMouse()
  16. local CurrentCamera = workspace.CurrentCamera
  17. local plr = plrs.LocalPlayer
  18. local mouse = plr:GetMouse()
  19. local camera = workspace.CurrentCamera
  20. local worldToViewportPoint = camera.worldToViewportPoint
  21. local cc = Instance.new("ColorCorrectionEffect", game.Lighting)
  22. local blur = Instance.new("BlurEffect", game.Lighting)
  23. local sun = Instance.new("SunRaysEffect", game.Lighting)
  24. blur.Size = 0
  25. sun.Intensity = 0
  26.  
  27. --[Optimisation Variables]
  28.  
  29. local Drawingnew = Drawing.new
  30. local Color3fromRGB = Color3.fromRGB
  31. local Vector3new = Vector3.new
  32. local Vector2new = Vector2.new
  33. local mathfloor = math.floor
  34. local mathceil = math.ceil
  35.  
  36. --[Setup Table]
  37.  
  38. local esp = {
  39. players = {},
  40. enabled = true,
  41. teamcheck = true,
  42. fontsize = 16,
  43. font = 0,
  44. settings = {
  45. name = {enabled = true, outline = true, color = Color3fromRGB(255, 255, 255), outlineColor = Color3fromRGB(94, 0, 255)},
  46. box = {enabled = true, outline = true, color = Color3fromRGB(131, 105, 165), outlineColor = Color3fromRGB(0, 0, 0)},
  47. healthbar = {enabled = true, outline = true, color = Color3fromRGB(111, 0, 255), outlineColor = Color3fromRGB(0, 0, 0)},
  48. healthtext = {enabled = true, outline = true, color = Color3fromRGB(255, 255, 255), outlineColor = Color3fromRGB(94, 0, 255)},
  49. distance = {enabled = true, outline = true, color = Color3fromRGB(255, 255, 255), outlineColor = Color3fromRGB(94, 0, 255)}
  50. }
  51. }
  52.  
  53. esp.NewDrawing = function(type, properties)
  54. local newDrawing = Drawingnew(type)
  55.  
  56. for i,v in next, properties or {} do
  57. newDrawing[i] = v
  58. end
  59.  
  60. return newDrawing
  61. end
  62.  
  63. esp.NewPlayer = function(v)
  64. esp.players[v] = {
  65. name = esp.NewDrawing("Text", {Color = Color3fromRGB(94, 0, 255), Outline = true, Center = true, Size = 13, Font = 0}),
  66. boxOutline = esp.NewDrawing("Square", {Color = Color3fromRGB(0, 0, 0), Thickness = 3}),
  67. box = esp.NewDrawing("Square", {Color = Color3fromRGB(108, 11, 204), Thickness = 1}),
  68. healthBarOutline = esp.NewDrawing("Line", {Color = Color3fromRGB(0, 0, 0), Thickness = 3}),
  69. healthBar = esp.NewDrawing("Line", {Color = Color3fromRGB(255, 255, 255), Thickness = 1}),
  70. healthText = esp.NewDrawing("Text", {Color = Color3fromRGB(94, 0, 255), Outline = true, Center = true, Size = 13, Font = 0}),
  71. distance = esp.NewDrawing("Text", {Color = Color3fromRGB(94, 0, 255), Outline = true, Center = true, Size = 13, Font = 0})
  72. }
  73. end
  74.  
  75. for _,v in ipairs(plrs:GetPlayers()) do
  76. esp.NewPlayer(v)
  77. end
  78.  
  79. plrs.PlayerAdded:Connect(function(v)
  80. esp.NewPlayer(v)
  81. end)
  82.  
  83. plrs.PlayerRemoving:Connect(function(v)
  84. for i,v in pairs(esp.players[v]) do
  85. v:Remove()
  86. end
  87. esp.players[v] = nil
  88. end)
  89.  
  90. local mainLoop = rs.RenderStepped:Connect(function()
  91. for i,v in pairs(esp.players) do
  92. if i ~= plr and i.Character and i.Character:FindFirstChild("Humanoid") and i.Character:FindFirstChild("HumanoidRootPart") and i.Character:FindFirstChild("Head") then
  93. local hum = i.Character.Humanoid
  94. local hrp = i.Character.HumanoidRootPart
  95. local head = i.Character.Head
  96.  
  97. local Vector, onScreen = camera:WorldToViewportPoint(i.Character.HumanoidRootPart.Position)
  98.  
  99. local Size = (camera:WorldToViewportPoint(hrp.Position - Vector3new(0, 3, 0)).Y - camera:WorldToViewportPoint(hrp.Position + Vector3new(0, 2.6, 0)).Y) / 2
  100. local BoxSize = Vector2new(mathfloor(Size * 1.5), mathfloor(Size * 1.9))
  101. local BoxPos = Vector2new(mathfloor(Vector.X - Size * 1.5 / 2), mathfloor(Vector.Y - Size * 1.6 / 2))
  102.  
  103. local BottomOffset = BoxSize.Y + BoxPos.Y + 1
  104.  
  105. if onScreen and esp.enabled then
  106. if esp.settings.name.enabled then
  107. v.name.Position = Vector2new(BoxSize.X / 2 + BoxPos.X, BoxPos.Y - 16)
  108. v.name.Outline = esp.settings.name.outline
  109. v.name.Text = tostring(i)
  110. v.name.Color = esp.settings.name.color
  111. v.name.OutlineColor = esp.settings.name.outlineColor
  112. v.name.Font = esp.font
  113. v.name.Size = esp.fontsize
  114.  
  115. v.name.Visible = true
  116. else
  117. v.name.Visible = false
  118. end
  119.  
  120. if esp.settings.distance.enabled and plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") then
  121. v.distance.Position = Vector2new(BoxSize.X / 2 + BoxPos.X, BottomOffset)
  122. v.distance.Outline = esp.settings.distance.outline
  123. v.distance.Text = "[" .. mathfloor((hrp.Position - plr.Character.HumanoidRootPart.Position).Magnitude) .. "m]"
  124. v.distance.Color = esp.settings.distance.color
  125. v.distance.OutlineColor = esp.settings.distance.outlineColor
  126. BottomOffset = BottomOffset + 15
  127.  
  128. v.distance.Font = esp.font
  129. v.distance.Size = esp.fontsize
  130.  
  131. v.distance.Visible = true
  132. else
  133. v.distance.Visible = false
  134. end
  135.  
  136. if esp.settings.box.enabled then
  137. v.boxOutline.Size = BoxSize
  138. v.boxOutline.Position = BoxPos
  139. v.boxOutline.Visible = esp.settings.box.outline
  140. v.boxOutline.Color = esp.settings.box.outlineColor
  141.  
  142. v.box.Size = BoxSize
  143. v.box.Position = BoxPos
  144. v.box.Color = esp.settings.box.color
  145. v.box.Visible = true
  146. else
  147. v.boxOutline.Visible = false
  148. v.box.Visible = false
  149. end
  150.  
  151. if esp.settings.healthbar.enabled then
  152. v.healthBar.From = Vector2new((BoxPos.X - 5), BoxPos.Y + BoxSize.Y)
  153. v.healthBar.To = Vector2new(v.healthBar.From.X, v.healthBar.From.Y - (hum.Health / hum.MaxHealth) * BoxSize.Y)
  154. v.healthBar.Color = esp.settings.healthbar.color
  155. v.healthBar.Visible = true
  156.  
  157. v.healthBarOutline.From = Vector2new(v.healthBar.From.X, BoxPos.Y + BoxSize.Y + 1)
  158. v.healthBarOutline.To = Vector2new(v.healthBar.From.X, (v.healthBar.From.Y - 1 * BoxSize.Y) -1)
  159. v.healthBarOutline.Color = esp.settings.healthbar.outlineColor
  160. v.healthBarOutline.Visible = esp.settings.healthbar.outline
  161. else
  162. v.healthBarOutline.Visible = false
  163. v.healthBar.Visible = false
  164. end
  165.  
  166. if esp.settings.healthtext.enabled then
  167. v.healthText.Text = tostring(mathfloor((hum.Health / hum.MaxHealth) * 100 + 0.5))
  168. v.healthText.Position = Vector2new((BoxPos.X - 20), (BoxPos.Y + BoxSize.Y - 1 * BoxSize.Y) -1)
  169. v.healthText.Color = esp.settings.healthtext.color
  170. v.healthText.OutlineColor = esp.settings.healthtext.outlineColor
  171. v.healthText.Outline = esp.settings.healthtext.outline
  172.  
  173. v.healthText.Font = esp.font
  174. v.healthText.Size = esp.fontsize
  175.  
  176. v.healthText.Visible = true
  177. else
  178. v.healthText.Visible = false
  179. end
  180.  
  181. if esp.teamcheck then
  182. if v.TeamColor ~= plr.TeamColor then
  183. v.name.Visible = esp.settings.name.enabled
  184. v.box.Visible = esp.settings.box.enabled
  185. v.healthBar.Visible = esp.settings.healthbar.enabled
  186. v.healthText.Visible = esp.settings.healthtext.enabled
  187. v.distance.Visible = esp.settings.distance.enabled
  188. else
  189. v.name.Visible = false
  190. v.boxOutline.Visible = false
  191. v.box.Visible = false
  192. v.healthBarOutline.Visible = false
  193. v.healthBar.Visible = false
  194. v.healthText.Visible = false
  195. v.distance.Visible = false
  196. end
  197. end
  198. else
  199. v.name.Visible = false
  200. v.boxOutline.Visible = false
  201. v.box.Visible = false
  202. v.healthBarOutline.Visible = false
  203. v.healthBar.Visible = false
  204. v.healthText.Visible = false
  205. v.distance.Visible = false
  206. end
  207. else
  208. v.name.Visible = false
  209. v.boxOutline.Visible = false
  210. v.box.Visible = false
  211. v.healthBarOutline.Visible = false
  212. v.healthBar.Visible = false
  213. v.healthText.Visible = false
  214. v.distance.Visible = false
  215. end
  216. end
  217. end)
  218.  
  219. getgenv().esp = esp
Add Comment
Please, Sign In to add comment