How can I make the player not see their own highlight

How can I make the player not see their own highlight?

https://gyazo.com/76587d1d844f397696f96886db4f955e
https://gyazo.com/4998c6794638a77650b978599618ac2e

This is the script

local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local highlight = Instance.new("Highlight")
		highlight.Parent = character
		highlight.FillTransparency = 1
		highlight.OutlineColor = Color3.fromRGB(0,214,255)
		highlight.OutlineTransparency = 0
	end)
end)
1 Like

You could add a local script which looks for a highlight inside the character, and if it’s found then make it transparent.

Add a local script into StarterPlayerScripts and paste this inside:

--//Services
local Players = game:GetService("Players")

--//Variables
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()

--//Functions
local function InitializeCharacter(character)
	local Highlight = character:WaitForChild("Highlight")
	Highlight:Destroy()
end

InitializeCharacter(Character)

LocalPlayer.CharacterAdded:Connect(function(character)
	InitializeCharacter(character)
end)

Considering this is just for an effect (‘Highlight’ instance) the functionality may as well be handled by the client.

--LOCAL

local Game = game
local Players = Game:GetService("Players")
local LocalPlayer = Players.LocalPlayer

local function OnPlayerAdded(Player)
	if Player == LocalPlayer then return end
	local function OnCharacterAdded(Character)
		local Highlight = Instance.new("Highlight")
		Highlight.Adornee = Character
		Highlight.Parent = Character
	end
	
	Player.CharacterAdded:Connect(OnCharacterAdded)
	local Character = Player.Character
	if Character then task.spawn(OnCharacterAdded, Character) end
end

Players.PlayerAdded:Connect(OnPlayerAdded)
for _, Player in ipairs(Players:GetPlayers()) do
	task.spawn(OnPlayerAdded, Player)
end

It worked! Thanks for the reply