
KeylessUniversal

-- LocalScript: place in StarterPlayerScripts
-- ============ HIGHLIGHT ALL PLAYERS ============
local Settings = {
FillColor = Color3.fromRGB(255, 0, 0),
OutlineColor = Color3.fromRGB(255, 255, 255),
FillTransparency = 0.5,
OutlineTransparency = 0,
ToggleKey = Enum.KeyCode.H,
}
local Players = game.Players
local UserInputService = game:GetService("UserInputService")
local localPlayer = Players.LocalPlayer
local enabled = false
local highlights = {}
local function addHighlight(character)
if not character then return end
if highlights[character] then return end
local highlight = Instance.new("Highlight")
highlight.Name = "PlayerHighlight"
highlight.FillColor = Settings.FillColor
highlight.OutlineColor = Settings.OutlineColor
highlight.FillTransparency = Settings.FillTransparency
highlight.OutlineTransparency = Settings.OutlineTransparency
highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
highlight.Parent = character
highlights[character] = highlight
end
local function removeHighlight(character)
local highlight = highlights[character]
if highlight then
highlight:Destroy()
highlights[character] = nil
end
end
local function highlightAll()
for _, plr in pairs(Players:GetPlayers()) do
if plr ~= localPlayer and plr.Character then
addHighlight(plr.Character)
end
end
end
local function removeAll()
for character, _ in pairs(highlights) do
removeHighlight(character)
end
end
local function toggleHighlights()
enabled = not enabled
if enabled then
highlightAll()
else
removeAll()
end
end
-- keep highlighting players who join or respawn while enabled
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(character)
if enabled and plr ~= localPlayer then
addHighlight(character)
end
end)
end)
for _, plr in pairs(Players:GetPlayers()) do
if plr ~= localPlayer then
plr.CharacterAdded:Connect(function(character)
if enabled then
addHighlight(character)
end
end)
end
end
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Settings.ToggleKey then
toggleHighlights()
end
end)No comments yet for this script.



