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

How can you make it so you can change all the parts of a model change colour?

So like:

function onTouch(Touched)
 if Touched.Parent:findFirstChild("Humanoid") then

So then it finds all the children of the model called Point and makes all their colours say blue (I know each of ROBLOX's 64 colours have a different number for scripting), the makes all the children (parts inside the model) blue then it

wait (30)

Then all their colours go back to white. Thank you in advance.

1 answer

I believe that this is along the lines of what you want:

function onTouch(part)
	if part.Parent:findFirstChild("Humanoid") then
		for i,v in pairs(part.Parent:GetChildren) do
			if v:IsA("Part") then
				v.BrickColor=BrickColor.new("Bright blue")
			end
		end
	end
end
game.Workspace.Part.Touched:connect(onTouch)

This should change the parts of the character to blue, and with it you can easilly reverse the change. Im sorry if anything is wrong or unworking, I stopped scripting for a while so it might not work as planned.

1 comment

0

I don't want the parts of the character, I require the parts of the model that the character touches.

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