-- ESP Script -- Players = Green | NPC = Yellow -- Script by: JigglingCheeks repeat task.wait() until game:IsLoaded() local Players = game:GetService("Players") local RunService = game:GetService("RunService") local StarterGui = game:GetService("StarterGui") local UserInputService = game:GetService("UserInputService") local workspace = game:GetService("Workspace") local LocalPlayer = Players.LocalPlayer local enabled = true local playerColor = Color3.fromRGB(0, 255, 0) local npcColor = Color3.fromRGB(255, 255, 0) local npcNameMaxDistance = 500 local nameMode = "displayname" local npcList = {} local function notify(title, text, duration) pcall(function() StarterGui:SetCore("SendNotification", { Title = title, Text = text, Duration = duration or 3 }) end) end notify("System Notification", "Author: SynX2025", 5) local function getAdornee(model) return model:FindFirstChild("HumanoidRootPart") or model:FindFirstChild("Head") or model:FindFirstChild("UpperTorso") or model:FindFirstChild("Torso") end local function isPlayerCharacter(model) return model and model:IsA("Model") and Players:GetPlayerFromCharacter(model) ~= nil end local function isNPC(model) if not model or not model:IsA("Model") then return false end if isPlayerCharacter(model) then return false end return model:FindFirstChildOfClass("Humanoid") ~= nil and getAdornee(model) ~= nil end local function getLocalRoot() local char = LocalPlayer.Character return char and char:FindFirstChild("HumanoidRootPart") end local function distToModel(model) local root = getLocalRoot() local part = getAdornee(model) if not root or not part then return math.huge end return (root.Position - part.Position).Magnitude end local function safeDestroy(parent, name, className) local child = parent and parent:FindFirstChild(name) if child and child:IsA(className) then child:Destroy() end end local function ensureHighlight(model, color, name) safeDestroy(model, name, "Highlight") local hl = Instance.new("Highlight") hl.Name = name hl.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop hl.FillColor = color hl.OutlineColor = color hl.Enabled = enabled hl.Parent = model return hl end local function ensureBox(part, color, name) safeDestroy(part, name, "BoxHandleAdornment") local box = Instance.new("BoxHandleAdornment") box.Name = name box.Size = Vector3.new(2, 3, 2) box.Adornee = part box.AlwaysOnTop = true box.ZIndex = 5 box.Transparency = 1 box.Color3 = color box.Visible = enabled box.Parent = part return box end local function ensureNameTag(model, color, name) local part = model:FindFirstChild("Head") or model:FindFirstChild("HumanoidRootPart") or getAdornee(model) if not part then return nil end safeDestroy(part, name, "BillboardGui") local gui = Instance.new("BillboardGui") gui.Name = name gui.Adornee = part gui.AlwaysOnTop = true gui.Size = UDim2.new(0, 180, 0, 28) -- Smaller name tag gui.StudsOffset = Vector3.new(0, 2.4, 0) -- Slightly lowered gui.MaxDistance = 1000 gui.Parent = part 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.TextScaled = true label.TextStrokeTransparency = 0.35 label.TextColor3 = color label.Text = "" label.Parent = gui return gui, label, part end local function applyPlayerESP(plr) if not plr or plr == LocalPlayer then return end local char = plr.Character if not char then return end ensureHighlight(char, playerColor, "GetReal") local part = getAdornee(char) if part then ensureBox(part, playerColor, "BoxESP") end local nameText = plr.DisplayName if nameMode == "username" then nameText = plr.Name elseif nameMode == "both" then nameText = string.format("%s (%s)", plr.DisplayName, plr.Name) end local gui, label = ensureNameTag(char, playerColor, "NameESP") if gui and label then local root = getLocalRoot() local dist = (root and part) and (root.Position - part.Position).Magnitude or 0 label.Text = string.format("%s [%dm]", nameText, math.floor(dist)) label.Visible = enabled gui.Enabled = enabled end end local function addNPC(model) if not isNPC(model) then return end if npcList[model] then return end npcList[model] = true local part = getAdornee(model) if not part then return end ensureHighlight(model, npcColor, "NPC_Highlight") ensureBox(part, npcColor, "NPC_Box") local gui, label = ensureNameTag(model, npcColor, "NPC_NameESP") if gui and label then gui.Enabled = false label.Visible = false end end local function removeNPC(model) npcList[model] = nil end local function refreshNPCNames() for model in pairs(npcList) do if not model or not model.Parent then npcList[model] = nil else local part = getAdornee(model) if part then local visible = distToModel(model) <= npcNameMaxDistance local gui = part:FindFirstChild("NPC_NameESP") if gui then gui.Enabled = enabled and visible local label = gui:FindFirstChild("NameLabel") if label then label.Visible = enabled and visible label.TextColor3 = npcColor label.Text = string.format("%s [%dm]", model.Name, math.floor(distToModel(model))) end end end end end end local npcScanIndex = 1 local npcScanBatch = 25 local scanList = {} local function rebuildScanList() scanList = workspace:GetDescendants() npcScanIndex = 1 end local function scanForNPCsStep() if #scanList == 0 then rebuildScanList() end local count = 0 while npcScanIndex <= #scanList and count < npcScanBatch do local obj = scanList[npcScanIndex] npcScanIndex += 1 count += 1 if obj and obj:IsA("Model") and isNPC(obj) then addNPC(obj) end end if npcScanIndex > #scanList then rebuildScanList() end end local function refreshAllESP() for _, plr in ipairs(Players:GetPlayers()) do applyPlayerESP(plr) end for model in pairs(npcList) do if model and model.Parent and isNPC(model) then local part = getAdornee(model) if part then ensureHighlight(model, npcColor, "NPC_Highlight") ensureBox(part, npcColor, "NPC_Box") end else npcList[model] = nil end end end UserInputService.InputBegan:Connect(function(input, processed) if processed then return end if input.KeyCode == Enum.KeyCode.RightBracket then enabled = not enabled notify("System Notification", enabled and "ESP Enabled" or "ESP Disabled") elseif input.KeyCode == Enum.KeyCode.LeftBracket then if nameMode == "displayname" then nameMode = "username" elseif nameMode == "username" then nameMode = "both" else nameMode = "displayname" end notify("System Notification", "Name ESP mode: " .. nameMode) end end) Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function() task.wait(0.3) applyPlayerESP(plr) end) end) for _, plr in ipairs(Players:GetPlayers()) do if plr ~= LocalPlayer then plr.CharacterAdded:Connect(function() task.wait(0.3) applyPlayerESP(plr) end) end end workspace.DescendantAdded:Connect(function(desc) if desc:IsA("Model") then task.defer(function() task.wait(0.15) if desc and desc.Parent and isNPC(desc) then addNPC(desc) end end) end end) workspace.DescendantRemoving:Connect(function(desc) if desc:IsA("Model") then removeNPC(desc) end end) rebuildScanList() local npcTimer = 0 local espTimer = 0 RunService.Heartbeat:Connect(function(dt) npcTimer += dt espTimer += dt if npcTimer >= 0.1 then npcTimer = 0 scanForNPCsStep() end if espTimer >= 1 then espTimer = 0 refreshAllESP() refreshNPCNames() end end) notify("System Notification", "Players always visible. NPCs are yellow and show when ≤500 studs.", 15)