Highlights keep adorning everything

i have this game where you can buy potions and items (which have a little vfx that give you a highlight) and everytime i join a server the highlights are just all over the place (this is an issue)

I STILL havent found the issue yet but i suspect that it might have something to do with the potions and items

I already asked once on the creation feedback and someone told me to ask in the scripting support section

For example there are some blocks of code from the items

this script runs on a localscript:

for i, Player in game.Players:GetPlayers() do
			task.spawn(function()
				local Character = Player.Character or Player.CharacterAdded:Wait()
				Character.Highlight.OutlineColor = Color3.fromRGB(0, 255, 0)
				Character.Highlight.OutlineTransparency = Color3.fromRGB(0, 255, 0)
				Character.Highlight.FillTransparency = 0
				Character.Highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
				local Tween = TweenService:Create(Character.Highlight, Info, Goal)
				Tween:Play()
				
				task.delay(2, function()
					Character.Highlight.OutlineColor = Color3.fromRGB(0, 0, 0)
					Character.Highlight.DepthMode = Enum.HighlightDepthMode.Occluded
					Tool:Destroy()
				end)
			end)
		end

this script runs on a server(legacy) script

Tool.Activated:Connect(function()
	local Humanoid = Tool.Parent:FindFirstChild("Humanoid")
	local WalkSpeed = Humanoid.WalkSpeed
	local Highlight = Instance.new("Highlight")
	Highlight.OutlineColor = Color3.fromRGB(0, 170, 255)
	Highlight.OutlineTransparency = 0
	Highlight.FillTransparency = 0
	Highlight.FillColor = Color3.fromRGB(0, 170, 255)
	Highlight.DepthMode = Enum.HighlightDepthMode.Occluded
	Highlight.Parent = Tool.Parent
end)

this script also runs on a server (legacy) script

Tool.Activated:Connect(function()
	local Humanoid = Tool.Parent:FindFirstChild("Humanoid")
	local WalkSpeed = Humanoid.WalkSpeed
	local Highlight = Instance.new("Highlight")
	Highlight.OutlineColor = Color3.fromRGB(255, 0, 0)
	Highlight.OutlineTransparency = 0
	Highlight.FillTransparency = 0
	Highlight.FillColor = Color3.fromRGB(255, 0, 0)
	Highlight.DepthMode = Enum.HighlightDepthMode.Occluded
	Highlight.Parent = Tool.Parent
end)

i can answer most questions except photos or videos as i cant make them

3 Likes

IF ONE OF THE SCRIPTS ARE IN STARTERCHARACTER:

just saw this post right now, and i want to tell you that you should replace

tool.Parent

with

local char = script.Parent.Parent

1 Like

if not, please tell me where they are located in the explorer

1 Like

this for some reason works, thanks!

2 Likes

YOOOO my first solution ever,

you’re welcome

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.