--- simple ESP, by Cookie_Devlopper
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local CONFIG = {
Enabled = true,
FillColor = Color3.fromRGB(255, 0, 0),
OutlineColor = Color3.fromRGB(255, 255, 255),
FillTransparency = 0.5,
OutlineTransparency = 0,
ShowTeammates = false,
}
local highlights = {}
local function addHighlight(target)
local char = target.Character
if not char then return end
if highlights[target] then
highlights[target]:Destroy()
highlights[target] = nil
end
local highlight = Instance.new("Highlight")
highlight.FillColor = CONFIG.FillColor
highlight.OutlineColor = CONFIG.OutlineColor
highlight.FillTransparency = CONFIG.FillTransparency
highlight.OutlineTransparency = CONFIG.OutlineTransparency
highlight.Adornee = char
highlight.Parent = char
highlights[target] = highlight
end
local function removeHighlight(target)
if highlights[target] then
highlights[target]:Destroy()
highlights[target] = nil
end
end
local function watchPlayer(target)
if target == player then return end
ct
if target.Character then
addHighlight(target)
end
target.CharacterAdded:Connect(function(char)
if not CONFIG.Enabled then return end
char:WaitForChild("HumanoidRootPart", 5)
task.wait(0.1)
addHighlight(target)
end)
end
RunService.Heartbeat:Connect(function()
if not CONFIG.Enabled then return end
for _, target in ipairs(Players:GetPlayers()) do
if target == player then continue end
if not CONFIG.ShowTeammates and target.Team == player.Team then continue end
local char = target.Character
if char then
local existing = highlights[target]
if not existing or not existing.Parent or existing.Adornee ~= char then
addHighlight(target)
end
end
end
end)
for _, target in ipairs(Players:GetPlayers()) do
watchPlayer(target)
end
Players.PlayerAdded:Connect(function(target)
watchPlayer(target)
end)
Players.PlayerRemoving:Connect(function(target)
removeHighlight(target)
end)
-- Toggle H
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.H then
CONFIG.Enabled = not CONFIG.Enabled
if CONFIG.Enabled then
for _, target in ipairs(Players:GetPlayers()) do
if target ~= player then
addHighlight(target)
end
end
print("ESP : ON")
else
for target in pairs(highlights) do
removeHighlight(target)
end
print("ESP : OFF")
end
end
end)
Comments
No comments yet
Be the first to share your thoughts!