-- StarterPlayer > StarterPlayerScripts > LocalScript local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local StarterGui = game:GetService("StarterGui") -- ==== CONFIG ==== local CONTAINER_NAME = "RuntimeItems" local TARGET_NAME = "ChallengePumpkin" local EXACT_MATCH = false -- false: accept "ChallengePumpkin_27", etc. local FIND_FIRST_ONLY = false -- false = highlight all spawns; true = one at a time but auto-rearm after it’s gone -- ================= local player = Players.LocalPlayer local guiRoot = player:WaitForChild("PlayerGui") -- --- Status badge --- local statusGui = Instance.new("ScreenGui") statusGui.Name = "ESP_Status" statusGui.ResetOnSpawn = false statusGui.Parent = guiRoot local status = Instance.new("TextLabel") status.Name = "Status" status.AnchorPoint = Vector2.new(0, 0) status.Position = UDim2.new(0, 12, 0, 12) status.Size = UDim2.new(0, 160, 0, 28) status.BackgroundTransparency = 0.25 status.BackgroundColor3 = Color3.fromRGB(30, 30, 30) status.Text = "ESP: WATCHING…" status.TextScaled = true status.Font = Enum.Font.GothamBold status.TextColor3 = Color3.new(1, 1, 1) status.Parent = statusGui local function notify(msg) pcall(function() StarterGui:SetCore("SendNotification", { Title = "ESP", Text = msg, Duration = 2 }) end) end local function setBadge(text, color) status.Text = text status.BackgroundColor3 = color end local function setBadgeOn() setBadge("ESP: ON", Color3.fromRGB(0,170,0)) end local function setBadgeOff() setBadge("ESP: OFF", Color3.fromRGB(170,30,30)) end local function setBadgeWatching() setBadge("ESP: WATCHING…", Color3.fromRGB(30,30,30)) end -- Helpers local function matchesTargetName(name) return EXACT_MATCH and name == TARGET_NAME or string.sub(name, 1, #TARGET_NAME) == TARGET_NAME end local function getLabelAnchorAndHeight(inst) if inst:IsA("BasePart") then return inst, inst.Size.Y elseif inst:IsA("Model") then local main = inst.PrimaryPart or inst:FindFirstChildWhichIsA("BasePart", true) local _, size = inst:GetBoundingBox() return main, size.Y end return nil, 6 end -- Data local container = workspace:WaitForChild(CONTAINER_NAME, 60) if not container then warn(("ESP: container '%s' not found in workspace"):format(CONTAINER_NAME)) return end -- Track ESP per instance local tracked = {} -- [Instance] = {h = Highlight, label = BillboardGui} local espEnabled = true local singleLocked = false -- when FIND_FIRST_ONLY is true, this gates the next acquire local function pulse(h) if not h then return end local orig = h.FillTransparency h.FillTransparency = math.clamp(orig - 0.35, 0, 1) task.wait(0.08) h.FillTransparency = orig end local function refreshEnabledFor(instPack) if instPack.h then instPack.h.Enabled = espEnabled end if instPack.label then instPack.label.Enabled = espEnabled end end local function makeESP(target) if tracked[target] then return end if not (target:IsA("BasePart") or target:IsA("Model")) then return end local h = Instance.new("Highlight") h.Name = TARGET_NAME .. "_ESP" h.Adornee = target h.FillColor = Color3.fromRGB(255, 128, 0) h.FillTransparency = 0.75 h.OutlineColor = Color3.fromRGB(255, 255, 255) h.OutlineTransparency = 0 h.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop h.Parent = target -- parent to target so it auto-cleans local anchor, heightY = getLabelAnchorAndHeight(target) local gui if anchor then gui = Instance.new("BillboardGui") gui.Name = TARGET_NAME .. "_Label" gui.Adornee = anchor gui.AlwaysOnTop = true gui.Size = UDim2.new(0, 180, 0, 36) gui.StudsOffset = Vector3.new(0, (heightY/2) + 1.5, 0) gui.MaxDistance = 800 gui.Parent = target -- parent to target for auto-clean local text = Instance.new("TextLabel") text.Size = UDim2.new(1, 0, 1, 0) text.BackgroundTransparency = 1 text.Text = TARGET_NAME text.Font = Enum.Font.GothamBold text.TextScaled = true text.TextColor3 = Color3.new(1, 1, 1) text.Parent = gui end tracked[target] = { h = h, label = gui } refreshEnabledFor(tracked[target]) -- Visual/audio feedback pulse(h) print("[ESP] Found:", target:GetFullName()) notify("Found "..TARGET_NAME) -- In single-mode, lock after first acquire if FIND_FIRST_ONLY then singleLocked = true end -- Auto-clean & auto-rearm for single-mode target.AncestryChanged:Connect(function(_, parent) if parent == nil then tracked[target] = nil -- If single-mode and the tracked one is gone, rearm to catch the next spawn if FIND_FIRST_ONLY then -- Only rearm if nothing else is tracked local hasAny = next(tracked) ~= nil if not hasAny then singleLocked = false if espEnabled then setBadgeWatching() print("[ESP] Rearmed: watching for next "..TARGET_NAME) end end end end end) end -- Toggle key local function setEnabled(on) espEnabled = on for _, pack in pairs(tracked) do refreshEnabledFor(pack) end if on then setBadgeOn() else setBadgeOff() end print("[ESP]", on and "ENABLED" or "DISABLED") end UserInputService.InputBegan:Connect(function(input, gp) if gp then return end if input.KeyCode == Enum.KeyCode.H then setEnabled(not espEnabled) end end) -- Consider any instance or its ancestors under container local function consider(inst) if not inst or not inst.Parent then return end -- Respect single-mode lock if FIND_FIRST_ONLY and singleLocked then return end if (inst:IsA("Model") or inst:IsA("BasePart")) and matchesTargetName(inst.Name) then makeESP(inst) return end local a = inst.Parent while a and a ~= container do if a:IsA("Model") and matchesTargetName(a.Name) then makeESP(a) return end a = a.Parent end end -- Initial state if espEnabled then setBadgeWatching() else setBadgeOff() end -- Sweep existing for _, d in ipairs(container:GetDescendants()) do consider(d) if FIND_FIRST_ONLY and singleLocked then break end end -- Always keep listening; gating is handled by singleLocked container.DescendantAdded:Connect(consider)