-- [[ Rscripts Risk Notice ]] -- This script is not verified by rscripts.net. Deal with caution. -- -- Stay safe: -- • Never log in on unofficial Roblox sites or lookalike domains. -- • Real Roblox links use roblox.com (check the .com ending). -- • Treat fake Roblox login / "claim reward" pages as phishing. -- [[ End Rscripts Risk Notice ]] if not game:IsLoaded() then game.Loaded:Wait() end local Players = game:GetService("Players") local localPlayer = Players.LocalPlayer assert(localPlayer, "Run this on the Roblox client.") local COLOR = Color3.fromRGB(255, 40, 70) local CLASS_D = "Class - D" local CHAOS = "Chaos Insurgency" local environment = getgenv and getgenv() or _G local previous = environment.__RayfieldTeamTools if type(previous) == "table" and type(previous.Cleanup) == "function" then previous.Cleanup() end if type(environment.__ChamsOnlyCleanup) == "function" then environment.__ChamsOnlyCleanup() end local running = true local records = {} local connections = {} local function connect(signal, callback, list) local connection = signal:Connect(function(...) if running then callback(...) end end) table.insert(list or connections, connection) end local function eligible(player) local team = player.Team local ownTeam = localPlayer.Team local allowed = false if player ~= localPlayer and team and ownTeam and team ~= ownTeam then local ownName = ownTeam.Name local targetName = team.Name if ownName == CLASS_D then allowed = targetName ~= CHAOS elseif ownName == CHAOS then allowed = targetName ~= CLASS_D else allowed = targetName == CLASS_D or targetName == CHAOS end end return allowed end local function restorePart(record, part) local original = record.parts[part] if not original then return end record.parts[part] = nil if part.Parent then part.Material = original.Material part.MaterialVariant = original.MaterialVariant part.Color = original.Color end end local function clearEffect(record) for _, connection in ipairs(record.effectConnections) do connection:Disconnect() end table.clear(record.effectConnections) if record.highlight then record.highlight:Destroy() record.highlight = nil end for part in pairs(record.parts) do restorePart(record, part) end end local function refresh(player) local record = records[player] if not record then return end clearEffect(record) local character = record.character if not character or not eligible(player) then return end local highlight = Instance.new("Highlight") highlight.Name = "ChamsOnlyHighlight" highlight.Adornee = character highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop highlight.FillColor = COLOR highlight.FillTransparency = 0.15 highlight.OutlineColor = Color3.new(1, 1, 1) highlight.OutlineTransparency = 0 highlight.Parent = character record.highlight = highlight local function makeNeon(part) if not part:IsA("BasePart") or record.parts[part] then return end record.parts[part] = { Material = part.Material, MaterialVariant = part.MaterialVariant, Color = part.Color, } part.MaterialVariant = "" part.Material = Enum.Material.Neon part.Color = COLOR end connect(character.DescendantAdded, makeNeon, record.effectConnections) connect(character.DescendantRemoving, function(part) restorePart(record, part) end, record.effectConnections) for _, part in ipairs(character:GetDescendants()) do makeNeon(part) end end local function trackPlayer(player) if player == localPlayer or records[player] then return end local record = { character = player.Character, parts = {}, connections = {}, effectConnections = {}, } records[player] = record connect(player.CharacterAdded, function(character) record.character = character refresh(player) end, record.connections) connect(player.CharacterRemoving, function(character) if record.character == character then record.character = nil clearEffect(record) end end, record.connections) for _, property in ipairs({"Team", "TeamColor", "Neutral"}) do connect(player:GetPropertyChangedSignal(property), function() refresh(player) end, record.connections) end refresh(player) end local function removePlayer(player) local record = records[player] if not record then return end clearEffect(record) for _, connection in ipairs(record.connections) do connection:Disconnect() end records[player] = nil end local function cleanup() if not running then return end running = false for _, connection in ipairs(connections) do connection:Disconnect() end for player in pairs(records) do removePlayer(player) end if environment.__ChamsOnlyCleanup == cleanup then environment.__ChamsOnlyCleanup = nil end end environment.__ChamsOnlyCleanup = cleanup connect(Players.PlayerAdded, trackPlayer) connect(Players.PlayerRemoving, removePlayer) for _, property in ipairs({"Team", "TeamColor", "Neutral"}) do connect(localPlayer:GetPropertyChangedSignal(property), function() for player in pairs(records) do refresh(player) end end) end if typeof(script) == "Instance" and script:IsA("LocalScript") then connect(script.Destroying, cleanup) end for _, player in ipairs(Players:GetPlayers()) do trackPlayer(player) end