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

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

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

✓ Accepted answer

`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) `

1 comment

0

Thanks, it is solved

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.

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