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.
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
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