Advertisement
HaloJnZ

ESP

May 25th, 2024 (edited)
753
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.17 KB | None | 0 0
  1. local function API_Check()
  2.     if Drawing == nil then
  3.         return "No"
  4.     else
  5.         return "Yes"
  6.     end
  7. end
  8.  
  9. local Find_Required = API_Check()
  10.  
  11. if Find_Required == "No" then
  12.     game:GetService("StarterGui"):SetCore("SendNotification",{
  13.         Title = "Incarcerated";
  14.         Text = "ESP script could not be loaded because your exploit is unsupported.";
  15.         Duration = math.huge;
  16.         Button1 = "OK"
  17.     })
  18.  
  19.     return
  20. end
  21.  
  22. local Players = game:GetService("Players")
  23. local RunService = game:GetService("RunService")
  24. local UserInputService = game:GetService("UserInputService")
  25. local Camera = workspace.CurrentCamera
  26.  
  27. local Typing = false
  28.  
  29. _G.SendNotifications = true   -- If set to true then the script would notify you frequently on any changes applied and when loaded / errored. (If a game can detect this, it is recommended to set it to false)
  30. _G.DefaultSettings = false   -- If set to true then the ESP script would run with default settings regardless of any changes you made.
  31.  
  32. _G.TeamCheck = false   -- If set to true then the script would create ESP only for the enemy team members.
  33.  
  34. _G.ESPVisible = true   -- If set to true then the ESP will be visible and vice versa.
  35. _G.TextColor = Color3.fromRGB(255, 80, 10)   -- The color that the boxes would appear as.
  36. _G.TextSize = 14   -- The size of the text.
  37. _G.Center = true   -- If set to true then the script would be located at the center of the label.
  38. _G.Outline = true   -- If set to true then the text would have an outline.
  39. _G.OutlineColor = Color3.fromRGB(0, 0, 0)   -- The outline color of the text.
  40. _G.TextTransparency = 0.7   -- The transparency of the text.
  41. _G.TextFont = Drawing.Fonts.UI   -- The font of the text. (UI, System, Plex, Monospace)
  42.  
  43. _G.DisableKey = Enum.KeyCode.Q   -- The key that disables / enables the ESP.
  44.  
  45. local function CreateESP()
  46.     for _, v in next, Players:GetPlayers() do
  47.         if v.Name ~= Players.LocalPlayer.Name then
  48.             local ESP = Drawing.new("Text")
  49.  
  50.             RunService.RenderStepped:Connect(function()
  51.                 if workspace:FindFirstChild(v.Name) ~= nil and workspace[v.Name]:FindFirstChild("HumanoidRootPart") ~= nil then
  52.                     local Vector, OnScreen = Camera:WorldToViewportPoint(workspace[v.Name]:WaitForChild("Head", math.huge).Position)
  53.  
  54.                     ESP.Size = _G.TextSize
  55.                     ESP.Center = _G.Center
  56.                     ESP.Outline = _G.Outline
  57.                     ESP.OutlineColor = _G.OutlineColor
  58.                     ESP.Color = _G.TextColor
  59.                     ESP.Transparency = _G.TextTransparency
  60.                     ESP.Font = _G.TextFont
  61.  
  62.                     if OnScreen == true then
  63.                         local Part1 = workspace:WaitForChild(v.Name, math.huge):WaitForChild("HumanoidRootPart", math.huge).Position
  64.                         local Part2 = workspace:WaitForChild(Players.LocalPlayer.Name, math.huge):WaitForChild("HumanoidRootPart", math.huge).Position or 0
  65.                         local Dist = (Part1 - Part2).Magnitude
  66.                         ESP.Position = Vector2.new(Vector.X, Vector.Y - 25)
  67.                         ESP.Text = ("("..tostring(math.floor(tonumber(Dist)))..") "..v.Name.." ["..workspace[v.Name].Humanoid.Health.."]")
  68.                         if _G.TeamCheck == true then
  69.                             if Players.LocalPlayer.Team ~= v.Team then
  70.                                 ESP.Visible = _G.ESPVisible
  71.                             else
  72.                                 ESP.Visible = false
  73.                             end
  74.                         else
  75.                             ESP.Visible = _G.ESPVisible
  76.                         end
  77.                     else
  78.                         ESP.Visible = false
  79.                     end
  80.                 else
  81.                     ESP.Visible = false
  82.                 end
  83.             end)
  84.  
  85.             Players.PlayerRemoving:Connect(function()
  86.                 ESP.Visible = false
  87.             end)
  88.         end
  89.     end
  90.  
  91.     Players.PlayerAdded:Connect(function(Player)
  92.         Player.CharacterAdded:Connect(function(v)
  93.             if v.Name ~= Players.LocalPlayer.Name then
  94.                 local ESP = Drawing.new("Text")
  95.    
  96.                 RunService.RenderStepped:Connect(function()
  97.                     if workspace:FindFirstChild(v.Name) ~= nil and workspace[v.Name]:FindFirstChild("HumanoidRootPart") ~= nil then
  98.                         local Vector, OnScreen = Camera:WorldToViewportPoint(workspace[v.Name]:WaitForChild("Head", math.huge).Position)
  99.    
  100.                         ESP.Size = _G.TextSize
  101.                         ESP.Center = _G.Center
  102.                         ESP.Outline = _G.Outline
  103.                         ESP.OutlineColor = _G.OutlineColor
  104.                         ESP.Color = _G.TextColor
  105.                         ESP.Transparency = _G.TextTransparency
  106.    
  107.                         if OnScreen == true then
  108.                             local Part1 = workspace:WaitForChild(v.Name, math.huge):WaitForChild("HumanoidRootPart", math.huge).Position
  109.                         local Part2 = workspace:WaitForChild(Players.LocalPlayer.Name, math.huge):WaitForChild("HumanoidRootPart", math.huge).Position or 0
  110.                             local Dist = (Part1 - Part2).Magnitude
  111.                             ESP.Position = Vector2.new(Vector.X, Vector.Y - 25)
  112.                             ESP.Text = ("("..tostring(math.floor(tonumber(Dist)))..") "..v.Name.." ["..workspace[v.Name].Humanoid.Health.."]")
  113.                             if _G.TeamCheck == true then
  114.                                 if Players.LocalPlayer.Team ~= Player.Team then
  115.                                     ESP.Visible = _G.ESPVisible
  116.                                 else
  117.                                     ESP.Visible = false
  118.                                 end
  119.                             else
  120.                                 ESP.Visible = _G.ESPVisible
  121.                             end
  122.                         else
  123.                             ESP.Visible = false
  124.                         end
  125.                     else
  126.                         ESP.Visible = false
  127.                     end
  128.                 end)
  129.    
  130.                 Players.PlayerRemoving:Connect(function()
  131.                     ESP.Visible = false
  132.                 end)
  133.             end
  134.         end)
  135.     end)
  136. end
  137.  
  138. if _G.DefaultSettings == true then
  139.     _G.TeamCheck = false
  140.     _G.ESPVisible = true
  141.     _G.TextColor = Color3.fromRGB(40, 90, 255)
  142.     _G.TextSize = 14
  143.     _G.Center = true
  144.     _G.Outline = false
  145.     _G.OutlineColor = Color3.fromRGB(0, 0, 0)
  146.     _G.DisableKey = Enum.KeyCode.Q
  147.     _G.TextTransparency = 0.75
  148. end
  149.  
  150. UserInputService.TextBoxFocused:Connect(function()
  151.     Typing = true
  152. end)
  153.  
  154. UserInputService.TextBoxFocusReleased:Connect(function()
  155.     Typing = false
  156. end)
  157.  
  158. UserInputService.InputBegan:Connect(function(Input)
  159.     if Input.KeyCode == _G.DisableKey and Typing == false then
  160.         _G.ESPVisible = not _G.ESPVisible
  161.        
  162.         if _G.SendNotifications == true then
  163.             game:GetService("StarterGui"):SetCore("SendNotification",{
  164.                 Title = "Incarcerated";
  165.                 Text = "The ESP's visibility is now set to "..tostring(_G.ESPVisible)..".";
  166.                 Duration = 5;
  167.             })
  168.         end
  169.     end
  170. end)
  171.  
  172. local Success, Errored = pcall(function()
  173.     CreateESP()
  174. end)
  175.  
  176. if Success and not Errored then
  177.     if _G.SendNotifications == true then
  178.         game:GetService("StarterGui"):SetCore("SendNotification",{
  179.             Title = "Incarcerated";
  180.             Text = "ESP script has successfully loaded.";
  181.             Duration = 5;
  182.         })
  183.     end
  184. elseif Errored and not Success then
  185.     if _G.SendNotifications == true then
  186.         game:GetService("StarterGui"):SetCore("SendNotification",{
  187.             Title = "Incarcerated";
  188.             Text = "ESP script has errored while loading, please check the developer console! (F9)";
  189.             Duration = 5;
  190.         })
  191.     end
  192.     TestService:Message("The ESP script has errored, please notify Exunys with the following information :")
  193.     warn(Errored)
  194.     print("!! IF THE ERROR IS A FALSE POSITIVE (says that a player cannot be found) THEN DO NOT BOTHER !!")
  195. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement