Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Mystdar 352 Moderation Voter
9 years ago

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

Log in to vote
0
Answered by
ultrabug 306 Moderation Voter
9 years ago

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.

0
I don't want the parts of the character, I require the parts of the model that the character touches. Mystdar 352 — 9y
Ad

Answer this question