How to make R15 Character completely white

I’m making this vampire game and I want the vampires’ skin to turn completely white when they are transformed. I do their abilities with a tool, so I found this piece of code that turns the character’s skin to white. But I don’t know how to make it apply completely for a R15 body.

Tool = script.Parent

local vCharacter = Tool.Parent

	local childs = vCharacter:GetChildren()

	local colors = {}

	for i=1,#childs do
		if (childs[i].className == "Part") then
			colors[i] = childs[i].BrickColor
			childs[i].BrickColor = BrickColor.new(1)
		end
	end

You need to change the character color using the BodyColors | Roblox Creator Documentation instance inside the character. Or you can delete that instance and do what is in your script.

There are bodycolors inside the parts of the character and there are colors inside of the humanoid description.

it works, but it only makes the character’s head turn white

Well then maybe it’s because the class of the other instances is BasePart and not part. So you need to check both.

uhhhh what? i’m not a scripter, I have no idea what any of this means lol

Tool = script.Parent

local vCharacter = Tool.Parent

	local childs = vCharacter:GetChildren()

	local colors = {}

	for i=1,#childs do
		if (childs[i].className == "Part" or childs[i].className == "MeshPart") then
			colors[i] = childs[i].BrickColor
			childs[i].BrickColor = BrickColor.new(1)
		end
	end

Try this

Tool = script.Parent

local vCharacter = Tool.Parent

	local childs = vCharacter:GetChildren()

	local colors = {}

	for i=1,#childs do
		if childs[i]:IsA("BasePart") or childs[i]:IsA("MeshPart") then
			colors[i] = childs[i].BrickColor
			childs[i].BrickColor = BrickColor.new(1)
		end
	end

Also instead of this you should do

for _,child in pairs(childs) do

Its simpler cuz instead of

child[i] 

you can do

child
1 Like