eruaaaaaaa

newww

Apr 30th, 2022 (edited)
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.67 KB | None | 0 0
  1. local ESP = {}
  2. ESP.__index = ESP
  3.  
  4. ESP.DefaultSettings = {
  5.     Enabled = true,
  6.     RefreshInterval = 10,
  7.     FlashInterval = 2,
  8.     Interval = true,
  9.     Boxes = true,
  10.     HealthBar = true,
  11.     Distance = true,
  12.     Names = true
  13. }
  14.  
  15. function ESP:AddHealthBar(character:  Model)
  16.     local HealthBarConnections: table = {}
  17.  
  18. end
  19.  
  20. function ESP:AddDistance(character: Model)
  21.     local DistanceConnections: table = {}
  22.  
  23. end
  24.  
  25. function ESP:AddName(character: Model)
  26.     local NameConnections: table = {}
  27.  
  28. end
  29.  
  30. function ESP:AddBox(character: Model)
  31.     local BoxConnections: table = {}
  32.     local BoxOutline = Drawing.new("Square")
  33.     BoxOutline.Visible = false
  34.     BoxOutline.Color = Color3.fromRGB(0, 0, 0)
  35.     BoxOutline.Thickness = 3
  36.     BoxOutline.Transparency = 1
  37.     BoxOutline.Filled = false
  38.    
  39.     local Box = Drawing.new("Square")
  40.     Box.Visible = false
  41.     Box.Color = Color3.fromRGB(255, 255, 255)
  42.     Box.Thickness = 1
  43.     Box.Transparency = 1
  44.     Box.Filled = false
  45.     table.insert(BoxConnections, game:GetService("RunService").RenderStepped:Connect(function()
  46.         if character ~= nil and character.Parent ~= nil and character:FindFirstChildOfClass("Humanoid") and character:FindFirstChild("HumanoidRootPart") then
  47.             local Root: Part = character.HumanoidRootPart
  48.             local Head: Part = character.Head
  49.             local Point, OnScreen = workspace.CurrentCamera:WorldToViewportPoint(Root.Position)
  50.             local RootPoint: Vector3 = workspace.CurrentCamera:WorldToViewportPoint(Root.Position)
  51.             local HeadPoint: Vector3 = workspace.CurrentCamera:WorldToViewportPoint(Head.Position + Vector3.new(0, 0.5, 0))
  52.             local LegPoint: Vector3 = workspace.CurrentCamera:WorldToViewportPoint(Root.Position - Vector3.new(0,3,0))
  53.             if OnScreen then
  54.                 BoxOutline.Size = Vector2.new(1000 / RootPoint.Z, HeadPoint.Y - LegPoint.Y)
  55.                 BoxOutline.Position = Vector2.new(RootPoint.X - BoxOutline.Size.X / 2, RootPoint.Y - BoxOutline.Size.Y / 2)
  56.                 BoxOutline.Visible = true
  57.                 Box.Size = Vector2.new(1000/ RootPoint.Z, HeadPoint.Y - LegPoint.Y)
  58.                 Box.Position = Vector2.new(RootPoint.X - Box.Size.X / 2, RootPoint.Y - Box.Size.Y / 2)
  59.                 Box.Visible = true
  60.             end
  61.         end
  62.     end))
  63.     return BoxConnections
  64. end
  65.  
  66. function ESP:AddPlayer(player: Player)
  67.     local function main()
  68.         if self.Enabled then
  69.             local char: Model = player.Character or player.CharacterAdded:Wait()
  70.             local hum: Humanoid = char:FindFirstChildOfClass("Humanoid")
  71.             if not hum then repeat task.wait() hum = hum:FindFirstChildOfClass("Humanoid") until hum and hum:IsA("Humanoid") end
  72.             local Connections: table = {}
  73.             if self.Boxes then table.insert(Connections, ESP:AddBox(player.Character)) end
  74.             hum.Died:Connect(function()
  75.                 for i,v in pairs(Connections) do
  76.                     for _, category in pairs(v) do
  77.                         category:Disconnect()
  78.                     end
  79.                 end
  80.             end)
  81.         end
  82.     end
  83.     if player.Character and player.Character:FindFirstChildOfClass("Humanoid") then
  84.         main()
  85.     end
  86.     player.CharacterAdded:Connect(main)
  87. end
  88.  
  89. function ESP:Startup()
  90.     for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  91.         ESP:AddPlayer(v)
  92.     end
  93.     game:GetService("Players").PlayerAdded:Connect(function(player: Player)
  94.         ESP:AddPlayer(Player)
  95.     end)
  96. end
  97.  
  98. function ESP.new(settings: table)
  99.     settings = settings or ESP.DefaultSettings
  100.     return setmetatable(settings, ESP)
  101. end
  102.  
  103. return ESP
Add Comment
Please, Sign In to add comment