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

How do I change the BrickColor onClicked? :D

Im making a button but I want the color to change from green to red on clicked :D Please Help.

script.Parent.ClickDetector.MouseClick:connect(function()
	script.Parent.BrickColor	=	BrickColor.new("Really red")
end)

1 answer

✓ Accepted answer

Are you trying to make it alternate? If so, you need a debounce.

green = true
script.Parent.ClickDetector.MouseClick:connect(function()
	if green == true then
		green = false
		script.Parent.BrickColor = BrickColor.new("Really red")
	else
		green = true
		script.Parent.BrickColor = BrickColor.new("Bright green")
	end
end)

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