Alright so I wanted this bright to change to 4 certain colors when I click the brick. This was my code, but it didn't work. Could you please help me out? Thanks!
local Brick = script.Parent function onClick() Brick.BrickColor = BrickColor.new("Bright orange","Bright red","Bright blue","Lime green") end Brick.ClickDetector.MouseClick:connect(onClick)
You would most likely have to do this:
local Brick = script.Parent function onClick() Brick.BrickColor = BrickColor.new("Bright orange") wait(1) Brick.BrickColor = BrickColor.new("Bright red") wait(1) Brick.BrickColor = BrickColor.new("Bright blue") wait(1) Brick.BrickColor = BrickColor.new("Lime green") end Brick.ClickDetector.MouseClick:connect(onClick)
For it to go randomly, do this:
local Brick = script.Parent function onClick() local random = math.random(1, 4) if random == 1 then Brick.BrickColor = BrickColor.new("Bright orange") elseif random == 2 then Brick.BrickColor = BrickColor.new("Bright red") elseif random == 3 then Brick.BrickColor = BrickColor.new("Bright blue") elseif random == 4 then Brick.BrickColor = BrickColor.new("Lime green") end Brick.ClickDetector.MouseClick:connect(onClick)