local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local COLOR_INNOCENT = Color3.fromRGB(85, 255, 127)
local COLOR_TRAITOR = Color3.fromRGB(255, 85, 85)
local COLOR_POLICE = Color3.fromRGB(85, 170, 255)
local COLOR_WEAPON = Color3.fromRGB(255, 170, 0)
local function getTeamInfo(player, character)
if player.Team then
return player.Team.Name, player.Team.TeamColor.Color
end
if character then
local customTeam = character:GetAttribute("rg_team")
if customTeam then
local color = Color3.new(1, 1, 1)
if customTeam == "Innocent" or customTeam == "Citizen" then color = COLOR_INNOCENT
elseif customTeam == "Traitor" or customTeam == "Bandit" then color = COLOR_TRAITOR
elseif customTeam == "Police" or customTeam == "Guard" then color = COLOR_POLICE end
return customTeam, color
end
end
return "Без команды", Color3.new(1, 1, 1)
end
local function updatePlayerESP(player, character)
if not character or not character.Parent then return end
local head = character:WaitForChild("Head", 5)
if not head or not character.Parent then return end
local esp = head:FindFirstChild("TeamESP")
if not esp then
esp = Instance.new("BillboardGui")
esp.Name = "TeamESP"
esp.Adornee = head
esp.Size = UDim2.new(0, 200, 0, 50)
esp.StudsOffset = Vector3.new(0, 3, 0)
esp.AlwaysOnTop = true
esp.Parent = head
local textLabel = Instance.new("TextLabel")
textLabel.Name = "Info"
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.BackgroundTransparency = 1
textLabel.TextSize = 14
textLabel.Font = Enum.Font.GothamBold
textLabel.TextStrokeTransparency = 0
textLabel.Parent = esp
end
local textLabel = esp:FindFirstChild("Info")
if textLabel then
local teamName, teamColor = getTeamInfo(player, character)
textLabel.Text = string.format("%s\n[%s]", player.DisplayName or player.Name, teamName)
textLabel.TextColor3 = teamColor
end
end
local function trackPlayer(player)
if player.Character then
updatePlayerESP(player, player.Character)
player.Character:GetAttributeChangedSignal("rg_team"):Connect(function()
updatePlayerESP(player, player.Character)
end)
end
player.CharacterAdded:Connect(function(character)
updatePlayerESP(player, character)
character:GetAttributeChangedSignal("rg_team"):Connect(function()
updatePlayerESP(player, character)
end)
end)
player:GetPropertyChangedSignal("Team"):Connect(function()
updatePlayerESP(player, player.Character)
end)
end
for _, player in ipairs(Players:GetPlayers()) do
if player ~= Players.LocalPlayer then trackPlayer(player) end
end
Players.PlayerAdded:Connect(function(player)
if player ~= Players.LocalPlayer then trackPlayer(player) end
end)
local function addWeaponESP(item)
task.wait(0.1)
local mainPart = nil
if item:IsA("Model") then
mainPart = item.PrimaryPart or item:FindFirstChild("Handle") or item:FindFirstChildWhichIsA("BasePart")
elseif item:IsA("Tool") then
mainPart = item:FindFirstChild("Handle")
elseif item:IsA("BasePart") then
mainPart = item
end
if not mainPart or mainPart:FindFirstChild("WeaponESP") then return end
local esp = Instance.new("BillboardGui")
esp.Name = "WeaponESP"
esp.Adornee = mainPart
esp.Size = UDim2.new(0, 150, 0, 30)
esp.StudsOffset = Vector3.new(0, 1.5, 0)
esp.AlwaysOnTop = true
esp.Parent = mainPart
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.BackgroundTransparency = 1
textLabel.TextSize = 12
textLabel.Font = Enum.Font.GothamSemibold
textLabel.TextStrokeTransparency = 0
textLabel.TextColor3 = COLOR_WEAPON
textLabel.Text = "🔫 " .. item.Name
textLabel.Parent = esp
end
local gameFolder = Workspace:FindFirstChild("Game")
if gameFolder then
local lootFolder = gameFolder:FindFirstChild("Loot")
if lootFolder then
for _, item in ipairs(lootFolder:GetChildren()) do
addWeaponESP(item)
end
lootFolder.ChildAdded:Connect(addWeaponESP)
end
end
for _, item in ipairs(Workspace:GetChildren()) do
if item:IsA("Tool") then
addWeaponESP(item)
end
end
Workspace.ChildAdded:Connect(function(item)
if item:IsA("Tool") then
addWeaponESP(item)
end
end)
Comments
its so skidded