Roblox Rainbow Color Changer Script
Here's a script that will cycle through bright, vibrant RGB colors (including cyan, light red, etc.) for a part in Roblox:
-- Place this script in a Part or a Model in Roblox Studio
local part = script.Parent
if not part:IsA("BasePart") then
part = part:FindFirstChildWhichIsA("BasePart")
if not part then
warn("No BasePart found to change color")
return
end
end
-- Bright, vibrant colors (RGB values)
local colors = {
Color3.fromRGB(255, 0, 0), -- Bright Red
Color3.fromRGB(255, 100, 0), -- Orange
Color3.fromRGB(255, 255, 0), -- Bright Yellow
Color3.fromRGB(0, 255, 0), -- Bright Green
Color3.fromRGB(0, 255, 255), -- Cyan
Color3.fromRGB(0, 100, 255), -- Light Blue
Color3.fromRGB(100, 0, 255), -- Purple
Color3.fromRGB(255, 0, 255), -- Magenta
Color3.fromRGB(255, 150, 150), -- Light Pink
Color3.fromRGB(150, 255, 150), -- Mint
Color3.fromRGB(150, 150, 255) -- Light Blue
}
local colorSpeed = 0.5 -- Time in seconds between color changes
local currentIndex = 1
while true do
-- Smooth transition between colors
local nextIndex = currentIndex % #colors + 1
local t = 0
while t < 1 do
t = t + (colorSpeed/10)
part.Color = colors[currentIndex]:Lerp(colors[nextIndex], t)
wait(colorSpeed/10)
end
currentIndex = nextIndex
end
How to Use:
- Insert this script into any BasePart (like a Part, MeshPart, etc.) in Roblox Studio
- The part will start cycling through bright, vibrant colors
- You can adjust the
colorSpeed variable to make the transitions faster or slower
Customization Options:
- Add more colors to the
colors table if you want specific bright colors
- Change
colorSpeed to adjust how quickly the colors change
- For a more "rainbow" effect, you could use HSV color space instead (let me know if you'd prefer that version)
Would you like me to modify this script in any way? Maybe make it affect multiple parts or add specific effects?