My script is supposed to make a baseplate where if you click a button it goes disco, and if you click off, it goes back to normal. The problem is it doesent do any of that. I don't think that it's registering the click.
local baseplate = game.Workspace.BasePlate local on = false function onClicked() on = true end script.Parent.ClickDetector.MouseClick:connect(onClicked) function onClicked2() on = false end script.Parent.Parent.Off.ClickDetector.MouseClick:connect(onClicked) if on == true then while true do baseplate.BrickColor = BrickColor.new("Bright red") wait(0.1) baseplate.BrickColor = BrickColor.new("Bright violet") wait(0.1) baseplate.BrickColor = BrickColor.new("Hot pink") wait(0.1) baseplate.BrickColor = BrickColor.new("New Yeller") wait(0.1) baseplate.BrickColor = BrickColor.new("Lime green") wait(0.1) baseplate.BrickColor = BrickColor.new("Really blue") wait(0.1) end end if on == false then baseplate.BrickColor = BrickColor.new("Dark stone grey") end
Try this local baseplate = game.Workspace.BasePlate local on = false function onClicked() on = true end function onClicked2() on = false end if on == true then while true do baseplate.BrickColor = BrickColor.new("Bright red") wait(0.1) baseplate.BrickColor = BrickColor.new("Bright violet") wait(0.1) baseplate.BrickColor = BrickColor.new("Hot pink") wait(0.1) baseplate.BrickColor = BrickColor.new("New Yeller") wait(0.1) baseplate.BrickColor = BrickColor.new("Lime green") wait(0.1) baseplate.BrickColor = BrickColor.new("Really blue") wait(0.1) end end if on == false then baseplate.BrickColor = BrickColor.new("Dark stone grey") end script.Parent.Parent.Off.ClickDetector.MouseClick:connect(onClicked) script.Parent.ClickDetector.MouseClick:connect(onClicked)
Not 100% Sure if it will work, but give it a try.