Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local char = string.char
- local function strToName(...) return char(...) end
- local Players = game:GetService(strToName(80,108,97,121,101,114,115)) -- Players
- local RunService = game:GetService(strToName(82,117,110,83,101,114,118,105,99,101)) -- RunService
- local StarterGui = game:GetService(strToName(83,116,97,114,116,101,114,71,117,105)) -- StarterGui
- local UserInputService = game:GetService(strToName(85,115,101,114,73,110,112,117,116,83,101,114,118,105,99,101)) -- InputService
- local LocalPlayer = Players.LocalPlayer
- local ESPEnabled = true
- local LastESPUpdate = 0
- -- ๐ **Improved Notification Function**
- local function Notify(title, message, duration)
- StarterGui:SetCore(strToName(83,101,110,100,78,111,116,105,102,105,99,97,116,105,111,110), {
- Title = title,
- Text = message,
- Duration = duration or 3
- })
- end
- Notify("UESP", "ESP Active. Press ] to toggle, [ to reload.", 5)
- -- โ **Safe Team Color Function**
- local function GetPlayerColor(Player)
- return (Player.Team and Player.Team.TeamColor.Color) or Color3.fromRGB(255, 255, 255)
- end
- -- ๐ **ESP Creation**
- local function CreateESP(Character, Player)
- if not Character then return end
- -- ๐ฆ **Box ESP (Now More Accurate)**
- local RootPart = Character:FindFirstChild("HumanoidRootPart") or Character:FindFirstChild("UpperTorso")
- if RootPart then
- local Box = RootPart:FindFirstChild("BoxESP")
- if not Box then
- Box = Instance.new("BoxHandleAdornment")
- Box.Name = "BoxESP"
- Box.Size = Vector3.new(1.3, 2.2, 1.3) -- ๐ง **Smaller for Accuracy**
- Box.Adornee = RootPart
- Box.AlwaysOnTop = true
- Box.ZIndex = 5
- Box.Transparency = 0.2
- Box.Parent = RootPart
- end
- Box.Color3 = GetPlayerColor(Player)
- Box.Visible = ESPEnabled
- end
- -- ๐ค **Name ESP (Adjusted for Distance)**
- local Head = Character:FindFirstChild("Head")
- if Head then
- local NameTag = Head:FindFirstChild("NameESP")
- if not NameTag then
- NameTag = Instance.new("BillboardGui")
- NameTag.Name = "NameESP"
- NameTag.Size = UDim2.new(0, 150, 0, 40)
- NameTag.Adornee = Head
- NameTag.AlwaysOnTop = true
- local Label = Instance.new("TextLabel")
- Label.Name = "NameLabel"
- Label.BackgroundTransparency = 1
- Label.Size = UDim2.new(1, 0, 1, 0)
- Label.Font = Enum.Font.SourceSansBold
- Label.TextStrokeTransparency = 0.5
- Label.Parent = NameTag
- NameTag.Parent = Head
- end
- -- ๐ **Distance-Based Scaling**
- local Distance = 0
- local LocalRoot = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
- if LocalRoot then
- Distance = (LocalRoot.Position - Head.Position).Magnitude
- end
- local Scale = math.clamp(1 - (Distance / 500), 0.5, 1)
- local Height = 3 + math.clamp(Distance / 40, 1, 10)
- NameTag.Size = UDim2.new(0, 150 * Scale, 0, 40 * Scale)
- NameTag.StudsOffset = Vector3.new(0, Height, 0)
- NameTag.NameLabel.Text = string.format("%s [%d studs]", Player.Name, math.floor(Distance))
- NameTag.NameLabel.TextColor3 = GetPlayerColor(Player)
- NameTag.NameLabel.TextSize = math.clamp(16 * Scale, 10, 16)
- NameTag.Enabled = ESPEnabled
- end
- -- ๐ฅ **Chams ESP (Now Properly Applied)**
- local Highlight = Character:FindFirstChild("ChamsESP")
- if not Highlight then
- Highlight = Instance.new("Highlight")
- Highlight.Name = "ChamsESP"
- Highlight.Parent = Character
- end
- Highlight.FillColor = GetPlayerColor(Player)
- Highlight.OutlineColor = GetPlayerColor(Player)
- Highlight.FillTransparency = 0.15 -- ๐ง **More Visible**
- Highlight.OutlineTransparency = 0
- Highlight.Enabled = ESPEnabled
- end
- -- ๐ **ESP Update Function (Now More Efficient)**
- local function UpdateESP()
- if tick() - LastESPUpdate < 0.1 then return end -- โณ **Updates Every 0.1s**
- LastESPUpdate = tick()
- for _, Player in ipairs(Players:GetPlayers()) do
- if Player ~= LocalPlayer and Player.Character then
- CreateESP(Player.Character, Player)
- end
- end
- end
- -- ๐ฎ **Toggle & Reload**
- UserInputService.InputBegan:Connect(function(Input, GameProcessed)
- if GameProcessed then return end
- if Input.KeyCode == Enum.KeyCode.RightBracket then
- ESPEnabled = not ESPEnabled
- Notify("UESP", ESPEnabled and "Enabled" or "Disabled")
- UpdateESP()
- elseif Input.KeyCode == Enum.KeyCode.LeftBracket then
- Notify("UESP", "ESP Reloaded")
- UpdateESP()
- end
- end)
- -- ๐ **Optimized RunService Connection**
- RunService.Heartbeat:Connect(UpdateESP)
Advertisement
Add Comment
Please, Sign In to add comment