-- Chams ESP — outlines enemies through walls, teammates are skipped entirely. -- No interface: nothing is drawn except Highlight instances on the enemy bodies. -- Toggle: RightShift. Re-executing the script replaces the previous run cleanly. -- -- Works with games that render players as custom rigs (workspace.Characters); -- falls back to Player.Character bodies when the folder is missing. local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local CONFIG = { fillColor = Color3.fromRGB(255, 55, 55), fillTransparency = 0.35, outlineColor = Color3.fromRGB(255, 255, 255), outlineTransparency = 0.2, alwaysOnTop = true, selfRadius = 2.5, -- bodies this close to the camera are your own rig ignoreTeammates = true, teammateCacheTime = 30, -- keep a body marked as ally this long after its marker disappears toggleKey = Enum.KeyCode.RightShift, interval = 0.25, marker = "ChamsESP", highlightName = "ChamsHighlight", } -- Replacing the previous run keeps a single set of handlers alive. if type(getgenv()._chamsCleanup) == "function" then pcall(getgenv()._chamsCleanup) end local localPlayer = Players.LocalPlayer local highlights: { [Model]: Highlight } = {} local connections: { RBXScriptConnection } = {} local teammateCache: { [Model]: number } = {} local enabled = true local accumulator = 0 local function destroyHighlight(model: Model) local highlight = highlights[model] if highlight then highlight:Destroy() highlights[model] = nil end end local function customRigFolder(): Folder? local folder = workspace:FindFirstChild("Characters") if folder and #folder:GetChildren() > 0 then return folder end return nil end local function modelFromAdornee(adornee: Instance?): Model? local folder = workspace:FindFirstChild("Characters") if not adornee or not folder then return nil end local node: Instance? = adornee while node and node.Parent ~= folder do node = node.Parent end if node and node:IsA("Model") then return node end return nil end -- The game already puts a nameplate on every ally's head; anything carrying one -- of those markers is a teammate and never gets chams. local function collectTeammates(): { [Model]: boolean } local teammates: { [Model]: boolean } = {} if not CONFIG.ignoreTeammates then return teammates end local playerGui = localPlayer:FindFirstChild("PlayerGui") if playerGui then local containers: { Instance } = { playerGui } for _, gui in playerGui:GetChildren() do if gui:IsA("ScreenGui") then table.insert(containers, gui) end end for _, container in containers do for _, gui in container:GetChildren() do if gui:IsA("BillboardGui") and gui.Adornee then local model = modelFromAdornee(gui.Adornee) if model then teammates[model] = true end end end end end -- Standard team games: same Team as the local player. if localPlayer.Team then for _, player in Players:GetPlayers() do if player ~= localPlayer and player.Team == localPlayer.Team and player.Character then teammates[player.Character] = true end end end return teammates end local function resolveTeammates(): { [Model]: boolean } local now = os.clock() local resolved: { [Model]: boolean } = {} for model in pairs(teammateCache) do if not model.Parent then teammateCache[model] = nil end end for model in pairs(collectTeammates()) do teammateCache[model] = now end for model, stamp in pairs(teammateCache) do if now - stamp <= CONFIG.teammateCacheTime then resolved[model] = true else teammateCache[model] = nil end end return resolved end local function isLocalBody(model: Model, folderMode: boolean): boolean if model == localPlayer.Character then return true end if not folderMode then return false end local root = model:FindFirstChild("Root") or model:FindFirstChild("HumanoidRootPart") if not root then return false end local camera = workspace.CurrentCamera return (root.Position - camera.CFrame.Position).Magnitude < CONFIG.selfRadius end local function applyChams(model: Model) if highlights[model] then return end for _, child in model:GetChildren() do if child.Name == CONFIG.highlightName and child:GetAttribute(CONFIG.marker) then child:Destroy() end end local highlight = Instance.new("Highlight") highlight.Name = CONFIG.highlightName highlight:SetAttribute(CONFIG.marker, true) highlight.Adornee = model highlight.DepthMode = CONFIG.alwaysOnTop and Enum.HighlightDepthMode.AlwaysOnTop or Enum.HighlightDepthMode.Occluded highlight.FillColor = CONFIG.fillColor highlight.FillTransparency = CONFIG.fillTransparency highlight.OutlineColor = CONFIG.outlineColor highlight.OutlineTransparency = CONFIG.outlineTransparency highlight.Parent = model highlights[model] = highlight end local function collectTargets(folderMode: boolean): { Model } local targets: { Model } = {} if folderMode then local folder = customRigFolder() if folder then for _, model in folder:GetChildren() do if model:IsA("Model") and model:FindFirstChild("Root") then table.insert(targets, model) end end end else for _, player in Players:GetPlayers() do if player ~= localPlayer and player.Character then table.insert(targets, player.Character) end end end return targets end local function reconcile() if not enabled then return end local folderMode = customRigFolder() ~= nil local targets = collectTargets(folderMode) local teammates = resolveTeammates() local seen: { [Model]: boolean } = {} for _, model in targets do seen[model] = true if isLocalBody(model, folderMode) or teammates[model] then destroyHighlight(model) else applyChams(model) end end for model in pairs(highlights) do if not seen[model] then destroyHighlight(model) end end end local function setEnabled(state: boolean) enabled = state if enabled then accumulator = CONFIG.interval reconcile() else for model in pairs(highlights) do destroyHighlight(model) end end end local function destroy() for model in pairs(highlights) do destroyHighlight(model) end for _, connection in connections do connection:Disconnect() end table.clear(connections) table.clear(teammateCache) getgenv()._chamsCleanup = nil getgenv().Chams = nil end -- Leftovers from an earlier run of this script. for _, player in Players:GetPlayers() do local character = player.Character if character then for _, child in character:GetChildren() do if child.Name == CONFIG.highlightName and child:GetAttribute(CONFIG.marker) then child:Destroy() end end end end table.insert(connections, RunService.Heartbeat:Connect(function(deltaTime) accumulator += deltaTime if accumulator < CONFIG.interval then return end accumulator = 0 reconcile() end)) table.insert(connections, UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed or input.KeyCode ~= CONFIG.toggleKey then return end setEnabled(not enabled) end)) getgenv()._chamsCleanup = destroy getgenv().Chams = { enabled = function(): boolean return enabled end, setEnabled = setEnabled, toggle = function() setEnabled(not enabled) end, destroy = destroy, } reconcile() local count = 0 for _ in pairs(highlights) do count += 1 end print(("[Chams] ready — %d enemies highlighted, teammates skipped, toggle: %s"):format(count, CONFIG.toggleKey.Name))