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

Why Cant I Color The Model I Designate When I Touch The Button?

Asked by
jacobwow 140
10 years ago

My goal is when i touch a button, the Model turns teal/ Bright bluish green. But when i touch the button, the model in my game called Base1 does not turn teal, none of it does.

function onTouch(part)
    local humanoid = part.Parent:FindFirstChild("Humanoid") 
    if (humanoid ~= nil) then
        game.Workspace.Base1:GetChildren().Color = Color3.new(0,200,175)
    end
end

script.Parent.Touched:connect(onTouch)

2 answers

Log in to vote
0
Answered by 10 years ago

`function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if (humanoid ~= nil) then for k,v in pairs(workspace.Base1:GetChildren()) do --This loops in the Base1 if v.ClassName == "Part" then --Checks if it is a part v.Color3 = Color3.new(0,200,175) --Then it changes the color in to that. end end end end

script.Parent.Touched:connect(onTouch) `

0
Thanks, it is solved jacobwow 140 — 10y
Ad
Log in to vote
-1
Answered by 10 years ago

You cant change the color of Humanoids. You have to change the color of a "Brick". You have to give the script an object to color. Not the name.

Answer this question