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

On first click flicker between two certain colors, on second click disable and turn white?

Asked by 7 years ago
Edited 7 years ago

I'm trying to make the cop light on top of a cop car and I want it so if you click on the light it flickers between Really Read and Deep Blue with 1.5 waits between and it continues untill clicked for the second time and it turns white and becomes disabled. If not possible the way I want it then whatever is closest. I have a part with a ClickDetector and these scripts

RedtoBlue (Disabled Script)

1while true do
2    script.Parent.BrickColor = BrickColor.new(Color3.new(255, 1, 1))
3    wait(1.5)
4    script.Parent.BrickColor = BrickColor.new(Color3.new(33, 84, 185))
5end

RedtoBlue Enable

1local function onMouseClick(player)
2    script.Parent.RedtoBlue.Disabled=false
3 
4end
5script.Parent.ClickDetector.MouseClick:connect(onMouseClick)

RedtoBlue Disable

1local function onMouseClick(player)
2    script.Parent.RedtoBlue.Disable=true
3        script.Parent.BrickColor = BrickColor.new(Color3.new(255, 255, 255))
4 
5end
6script.Parent.ClickDetector.MouseClickRight:connect(onMouseClick)

Please help, not working.

0
So what is the problem? LightPolaris 2 — 7y
0
Not sure, colors not changing, MouseClickRight isn't a real function, and I'm sure theres more wrong. barrettr500 53 — 7y

Answer this question