You need to put the script into StarterCharacterScript for it to work.
You can also use the following code (bellow) as it is simpler. However, if you’re looking to make a rainbow Highlight, I highly recommend to use a tween instead.
local Highlight = script.Parent:WaitForChild("Highlight", 60)
local HighlightColor = {
[1] = Color3.fromRGB(189, 82, 255),
[2] = Color3.fromRGB(160, 83, 255),
[3] = Color3.fromRGB(137, 83, 255),
[4] = Color3.fromRGB(123, 83, 255),
[5] = Color3.fromRGB(99, 85, 255),
[6] = Color3.fromRGB(82, 105, 255),
[7] = Color3.fromRGB(82, 137, 255),
[8] = Color3.fromRGB(82, 174, 255),
}
while true do
for Count = 1, #HighlightColor, 1 do
Highlight.OutlineColor = HighlightColor[Count]
task.wait(1)
end
for Count = #HighlightColor - 1, 2, -1 do
Highlight.OutlineColor = HighlightColor[Count]
task.wait(1)
end
end