Hello! I’m working on a sort of ESP system, where in one player in the game is chosen and every other player in the game is highlighted.
The script works fine, but only for 1 player. So it’s only highlighting one player thats in the game rather than all of the players in the game
I’ve looked for solutions on the developer hub, but couldn’t find anything similar to what I’m doing. I’m looking at my script and maybe because it’s 2AM but I can’t seem to snoop out what the issue may be. It’s a relatively simple script, which shouldn’t make it hard to find the issue.
game.ReplicatedStorage:WaitForChild("Remotes").Highlight.OnClientEvent:Connect(function()
for i,v in pairs(game.Players:GetChildren()) do
local char = v.Character or v.CharacterAdded:Wait()
local r = math.random(0,255)
local g = math.random(0,255)
local b = math.random(0,255)
for i,v in pairs(char:GetDescendants()) do
if v:IsA("BasePart") then
local Highlight = Instance.new("Highlight",v)
Highlight.FillTransparency = 1
Highlight.OutlineColor = Color3.fromRGB(r,g,b)
end
end
end
end)
All help is appreciated!
Thanks in advance!