local CollectionService = game:GetService("CollectionService")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
local TAG_NAME = "Bodycam_B"
local Config = {
EnemyColor = Color3.fromRGB(255, 0, 0),
HostageColor = Color3.fromRGB(0, 255, 0),
Outline = Color3.fromRGB(255, 255, 255),
Transparency = 0.5
}
local ESP = {}
function ESP:GetTeam(model)
local name = model.Name:lower()
if name:find("hostage") or name:find("civilian") or name:find("victim") then
return "Hostage"
end
return "Enemy"
end
function ESP:Apply(model)
if not model:IsA("Model") or CollectionService:HasTag(model, TAG_NAME) then
return
end
local humanoid = model:FindFirstChildOfClass("Humanoid")
if humanoid and not Players:GetPlayerFromCharacter(model) then
CollectionService:AddTag(model, TAG_NAME)
local team = self:GetTeam(model)
local highlight = Instance.new("Highlight")
highlight.Name = "ESP_Object"
highlight.FillColor = (team == "Hostage") and Config.HostageColor or Config.EnemyColor
highlight.OutlineColor = Config.Outline
highlight.FillTransparency = Config.Transparency
highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
highlight.Adornee = model
highlight.Parent = model
end
end
function ESP:Init()
workspace.DescendantAdded:Connect(function(desc)
if desc:IsA("Model") then
task.delay(0.2, function()
self:Apply(desc)
end)
end
end)
task.spawn(function()
local descendants = workspace:GetDescendants()
for i = 1, #descendants do
local obj = descendants[i]
pcall(function()
if obj:IsA("Model") then
self:Apply(obj)
end
end)
if i % 100 == 0 then task.wait() end
end
end)
end
ESP:Init()
Comments
Good Script
Why make one for a cash grab game?