Rainbow Pet Rarity

Hello developers, i want to make my pet rarity be a rainbow color but it dont working, how i can fix it?

local speed = 1
while wait() do
	for i = 0,1,0.001*speed do
		game.ReplicatedStorage.Pets.Rarities.Developer.Color.Value = Color3.fromHSV(i,1,1)
	end
end

Add a script inside your pet and set it’s RunContext to client for the best visuals.
image

Paste this inside the script:

--//Variables
local Part = script.Parent

--//Loops
while Part:IsDescendantOf(workspace) do
	for i = 0, 1, 0.001 do
		if not Part:IsDescendantOf(workspace) then
			break
		end
		
		Part.Color = Color3.fromHSV(i, 1, 1)
		
		task.wait()
	end
end

This should work if you’re changing the color of a pet.

it not in pet, i just want to change rarity color

What’s “rarity colour”? Is it text, a gui, or something else?

You need to task.wait() in each iteration.

Example:

while wait() do
	for i = 0,1,0.001*speed do
		game.ReplicatedStorage.Pets.Rarities.Developer.Color.Value = Color3.fromHSV(i,1,1)
        task.wait() -- this line is new
	end
end

You may also want to consider using your speed variable to wait rather than to increment i.

2 Likes

it just a folder with Color3Value and number value