Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why doesn't this make my brickColor back to normal?

After the wait(4) it doesnt change my torso color back to normal,Instead it makes it blue.why?

char = script.Parent.Parent.Character
local TorsoBrickColor = char.Torso.BrickColor
wait(2)
char.Torso.BrickColor = BrickColor.new("Camo")
wait(4)
char.Torso.BrickColor = TorsoBrickColor

1 answer

✓ Accepted answer

Models don't have brick colors.

You can't change the color of models. You can only change the color of bricks inside the model. So we can get the toros, head, legs, and arms. Another option would be changing body colors but nah.

I was midway into writing all the variables for the example, but that would take too long. Go with method number 2.

Another way,

We can loop through the character and turn everything to the brick color we want.

Example,

local char = script.Parent.Parent.Character
for i,v in pairs(char:GetChildren()) do
	if v:IsA("Part") then
		local VBrickColor = v.BrickColor
		wait(2)
		v.BrickColor = BrickColor.new("Camo")
		wait(4)
		v.BrickColor = VBrickColor
	end
end

This would work, but it wouldn't do everything at the same time. To make everything work at the same time, I'll be using the spawn function on a function.

local char = script.Parent.Parent.Character
for i,v in pairs(char:GetChildren()) do
	if v:IsA("Part") then
		spawn(function()
			local VBrickColor = v.BrickColor
			wait(2)
			v.BrickColor = BrickColor.new("Camo")
			wait(4)
			v.BrickColor = VBrickColor
		end
	end
end

Good Luck!

This discussion is preserved as it was. New answers, comments, and votes are closed.