1 | local esp_settings = { |
2 | textsize = 16, |
3 | colour = 255,255,255 |
4 | } |
5 | |
6 | local gui = Instance.new("BillboardGui") |
7 | local esp = Instance.new("TextLabel",gui) |
8 | |
9 | local plr = game.Players.LocalPlayer |
10 | |
11 | gui.Name = "ESP"; |
12 | gui.ResetOnSpawn = false |
13 | gui.AlwaysOnTop = true; |
14 | gui.LightInfluence = 0; |
15 | gui.Size = UDim2.new(1.75, 0, 1.75, 0); |
16 | esp.BackgroundColor3 = Color3.fromRGB(255, 255, 255); |
17 | esp.Text = "Spooky" |
18 | esp.Size = UDim2.new(0.0001, 0.00001, 0.0001, 0.00001); |
19 | esp.BorderSizePixel = 4; |
20 | esp.BorderColor3 = Color3.new(esp_settings.colour) |
21 | esp.BorderSizePixel = 0 |
22 | esp.Font = "GothamSemibold" |
23 | esp.TextSize = esp_settings.textsize |
24 | esp.TextColor3 = Color3.fromRGB(esp_settings.colour) |
25 | |
26 | _G.Active = true |
27 | |
28 | game:GetService("RunService").RenderStepped:Connect(function() |
29 | for i,v in pairs (workspace.Game.Players:GetDescendants()) do |
30 | if _G.Active and v:FindFirstChild("HRP") and v.HRP and v.HRP:FindFirstChild("ESP") == nil then |
31 | gui:Clone().Parent = v.HRP |
32 | end |
33 | end |
34 | end) |
35 | |
36 | -- Drawing Lib |
37 | |
38 | task.wait(.5) |
39 | |
40 | local lines = { |
41 | |
42 | } |
43 | |
44 | for i,v in pairs(workspace.Game.Players:GetDescendants()) do |
45 | if v.Name == "ESP" and _G.Active then |
46 | local camera = workspace.Camera |
47 | |
48 | local Line = Drawing.new("Line") |
49 | |
50 | table.insert(lines, {Line = Line, part = v.Parent}) |
51 | |
52 | Line.From = Vector2.new(camera.ViewportSize.X/2, camera.ViewportSize.Y) |
53 | Line.Color = Color3.fromRGB(255, 255, 255) |
54 | Line.Thickness = 2 |
55 | end |
56 | end |
57 | |
58 | workspace.Game.Players.DescendantAdded:Connect(function(v) |
59 | if v.Name == "ESP" and _G.Active then |
60 | local camera = workspace.Camera |
61 | local Line = Drawing.new("Line") |
62 | |
63 | table.insert(lines, {Line = Line, part = v.Parent}) |
64 | |
65 | Line.From = Vector2.new(camera.ViewportSize.X/2, camera.ViewportSize.Y) |
66 | Line.Color = Color3.fromRGB(255, 255, 255) |
67 | Line.Thickness = 2 |
68 | end |
69 | end) |
70 | |
71 | game:GetService("RunService").RenderStepped:Connect(function() |
72 | for i,v in pairs(lines) do |
73 | if v.part ~= nil and _G.Active then |
74 | local camera = workspace.Camera |
75 | local v2, inViewport = camera:WorldToViewportPoint(v.part.Position) |
76 | v.Line.To = Vector2.new(v2.X, v2.Y) |
77 | v.Line.From = Vector2.new(camera.ViewportSize.X/2, camera.ViewportSize.Y) |
78 | |
79 | v.Line.Visible = (inViewport and v.part and v.part.Parent and true) or false |
80 | |
81 | if v.part == nil then |
82 | v.Line.Visible = false |
83 | v.Line = nil |
84 | end |
85 | end |
86 | end |
87 | end) |