Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Settings = {
- Box_Color = Color3.fromRGB(255, 0, 0),
- Tracer_Color = Color3.fromRGB(255, 0, 0),
- Tracer_Thickness = 1,
- Box_Thickness = 1,
- Tracer_Origin = "Bottom", -- Middle or Bottom if FollowMouse is on this won't matter...
- Tracer_FollowMouse = false,
- Tracers = false
- }
- local Team_Check = {
- TeamCheck = true, -- if TeamColor is on this won't matter...
- Green = Color3.fromRGB(0, 255, 0),
- Red = Color3.fromRGB(255, 0, 0)
- }
- local TeamColor = true
- --// SEPARATION
- local player = game:GetService("Players").LocalPlayer
- local camera = game:GetService("Workspace").CurrentCamera
- local mouse = player:GetMouse()
- local function NewQuad(thickness, color)
- local quad = Drawing.new("Quad")
- quad.Visible = false
- quad.PointA = Vector2.new(0,0)
- quad.PointB = Vector2.new(0,0)
- quad.PointC = Vector2.new(0,0)
- quad.PointD = Vector2.new(0,0)
- quad.Color = color
- quad.Filled = false
- quad.Thickness = thickness
- quad.Transparency = 1
- return quad
- end
- local function NewLine(thickness, color)
- local line = Drawing.new("Line")
- line.Visible = false
- line.From = Vector2.new(0, 0)
- line.To = Vector2.new(0, 0)
- line.Color = color
- line.Thickness = thickness
- line.Transparency = 1
- return line
- end
- local function Visibility(state, lib)
- for u, x in pairs(lib) do
- x.Visible = state
- end
- end
- local function ToColor3(col) --Function to convert, just cuz c;
- local r = col.r --Red value
- local g = col.g --Green value
- local b = col.b --Blue value
- return Color3.new(r,g,b); --Color3 datatype, made of the RGB inputs
- end
- local black = Color3.fromRGB(0, 0 ,0)
- local function ESP(plr)
- local library = {
- --//Tracer and Black Tracer(black border)
- blacktracer = NewLine(Settings.Tracer_Thickness*2, black),
- tracer = NewLine(Settings.Tracer_Thickness, Settings.Tracer_Color),
- --//Box and Black Box(black border)
- black = NewQuad(Settings.Box_Thickness*2, black),
- box = NewQuad(Settings.Box_Thickness, Settings.Box_Color),
- --//Bar and Green Health Bar (part that moves up/down)
- healthbar = NewLine(3, black),
- greenhealth = NewLine(1.5, black)
- }
- local function Colorize(color)
- for u, x in pairs(library) do
- if x ~= library.healthbar and x ~= library.greenhealth and x ~= library.blacktracer and x ~= library.black then
- x.Color = color
- end
- end
- end
- local function Updater()
- local connection
- connection = game:GetService("RunService").RenderStepped:Connect(function()
- if plr.Character ~= nil and plr.Character:FindFirstChild("Humanoid") ~= nil and plr.Character:FindFirstChild("HumanoidRootPart") ~= nil and plr.Character.Humanoid.Health > 0 and plr.Character:FindFirstChild("Head") ~= nil then
- local HumPos, OnScreen = camera:WorldToViewportPoint(plr.Character.HumanoidRootPart.Position)
- if OnScreen then
- local head = camera:WorldToViewportPoint(plr.Character.Head.Position)
- local DistanceY = math.clamp((Vector2.new(head.X, head.Y) - Vector2.new(HumPos.X, HumPos.Y)).magnitude, 2, math.huge)
- local function Size(item)
- item.PointA = Vector2.new(HumPos.X + DistanceY, HumPos.Y - DistanceY*2)
- item.PointB = Vector2.new(HumPos.X - DistanceY, HumPos.Y - DistanceY*2)
- item.PointC = Vector2.new(HumPos.X - DistanceY, HumPos.Y + DistanceY*2)
- item.PointD = Vector2.new(HumPos.X + DistanceY, HumPos.Y + DistanceY*2)
- end
- Size(library.box)
- Size(library.black)
- --//Tracer
- if Settings.Tracers then
- if Settings.Tracer_Origin == "Middle" then
- library.tracer.From = camera.ViewportSize*0.5
- library.blacktracer.From = camera.ViewportSize*0.5
- elseif Settings.Tracer_Origin == "Bottom" then
- library.tracer.From = Vector2.new(camera.ViewportSize.X*0.5, camera.ViewportSize.Y)
- library.blacktracer.From = Vector2.new(camera.ViewportSize.X*0.5, camera.ViewportSize.Y)
- end
- if Settings.Tracer_FollowMouse then
- library.tracer.From = Vector2.new(mouse.X, mouse.Y+36)
- library.blacktracer.From = Vector2.new(mouse.X, mouse.Y+36)
- end
- library.tracer.To = Vector2.new(HumPos.X, HumPos.Y + DistanceY*2)
- library.blacktracer.To = Vector2.new(HumPos.X, HumPos.Y + DistanceY*2)
- else
- library.tracer.From = Vector2.new(0, 0)
- library.blacktracer.From = Vector2.new(0, 0)
- library.tracer.To = Vector2.new(0, 0)
- library.blacktracer.To = Vector2.new(0, 02)
- end
- --// Health Bar
- local d = (Vector2.new(HumPos.X - DistanceY, HumPos.Y - DistanceY*2) - Vector2.new(HumPos.X - DistanceY, HumPos.Y + DistanceY*2)).magnitude
- local healthoffset = plr.Character.Humanoid.Health/plr.Character.Humanoid.MaxHealth * d
- library.greenhealth.From = Vector2.new(HumPos.X - DistanceY - 4, HumPos.Y + DistanceY*2)
- library.greenhealth.To = Vector2.new(HumPos.X - DistanceY - 4, HumPos.Y + DistanceY*2 - healthoffset)
- library.healthbar.From = Vector2.new(HumPos.X - DistanceY - 4, HumPos.Y + DistanceY*2)
- library.healthbar.To = Vector2.new(HumPos.X - DistanceY - 4, HumPos.Y - DistanceY*2)
- local green = Color3.fromRGB(0, 255, 0)
- local red = Color3.fromRGB(255, 0, 0)
- library.greenhealth.Color = red:lerp(green, plr.Character.Humanoid.Health/plr.Character.Humanoid.MaxHealth);
- if Team_Check.TeamCheck then
- if plr.TeamColor == player.TeamColor then
- Colorize(Team_Check.Green)
- else
- Colorize(Team_Check.Red)
- end
- else
- library.tracer.Color = Settings.Tracer_Color
- library.box.Color = Settings.Box_Color
- end
- if TeamColor == true then
- Colorize(plr.TeamColor.Color)
- end
- Visibility(true, library)
- else
- Visibility(false, library)
- end
- else
- Visibility(false, library)
- if game.Players:FindFirstChild(plr.Name) == nil then
- connection:Disconnect()
- end
- end
- end)
- end
- coroutine.wrap(Updater)()
- end
- for i, v in pairs(game:GetService("Players"):GetPlayers()) do
- if v.Name ~= player.Name then
- coroutine.wrap(ESP)(v)
- end
- end
- game.Players.PlayerAdded:Connect(function(newplr)
- if newplr.Name ~= player.Name then
- coroutine.wrap(ESP)(newplr)
- end
- end)
- local c = workspace.CurrentCamera
- local ps = game:GetService("Players")
- local lp = ps.LocalPlayer
- local rs = game:GetService("RunService")
- local function esp(p,cr)
- local h = cr:WaitForChild("Humanoid")
- local hrp = cr:WaitForChild("HumanoidRootPart")
- local text = Drawing.new("Text")
- text.Visible = false
- text.Center = true
- text.Outline = false
- text.Font = 2
- text.Color = Color3.fromRGB(255,255,255)
- text.Size = 13
- local c1
- local c2
- local c3
- local function dc()
- text.Visible = false
- text:Remove()
- if c1 then
- c1:Disconnect()
- c1 = nil
- end
- if c2 then
- c2:Disconnect()
- c2 = nil
- end
- if c3 then
- c3:Disconnect()
- c3 = nil
- end
- end
- c2 = cr.AncestryChanged:Connect(function(_,parent)
- if not parent then
- dc()
- end
- end)
- c3 = h.HealthChanged:Connect(function(v)
- if (v<=0) or (h:GetState() == Enum.HumanoidStateType.Dead) then
- dc()
- end
- end)
- c1 = rs.RenderStepped:Connect(function()
- local hrp_pos,hrp_onscreen = c:WorldToViewportPoint(hrp.Position)
- if hrp_onscreen then
- text.Position = Vector2.new(hrp_pos.X, hrp_pos.Y)
- text.Text = p.Name
- text.Visible = true
- else
- text.Visible = false
- end
- end)
- end
- local function p_added(p)
- if p.Character then
- esp(p,p.Character)
- end
- p.CharacterAdded:Connect(function(cr)
- esp(p,cr)
- end)
- end
- for i,p in next, ps:GetPlayers() do
- if p ~= lp then
- p_added(p)
- end
- end
- ps.PlayerAdded:Connect(p_added)
Add Comment
Please, Sign In to add comment