Dwarlon
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 4604 |
|
|
| 14 Oct 2013 09:16 PM |
I can make a brick randomly color, but that is the easy part.
I need to know how to make it turn "Really Black" on click, but when it is clicked again turn on. So far, I have:
script.Parent = t while true do t.BrickColor = BrickColor.ReallyBlack() end function onclicked
t.ClickDetector.MouseClick:connect(onClicked)
Please help :) |
|
|
| Report Abuse |
|
|
Dwarlon
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 4604 |
|
|
| 14 Oct 2013 09:17 PM |
| WHOOPS!!! I meant Brickcolor.Random xP |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2013 09:18 PM |
script.Parent = t function onClicked() t.BrickColor = t.BrickColor == BrickColor.new("Really black") and BrickColor.new("Bright blue") or BrickColor.new("Really black") end
t.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2013 09:20 PM |
Change t.BrickColor = t.BrickColor == BrickColor.new("Really black") and BrickColor.new("Bright blue") or BrickColor.new("Really black")
to: t.BrickColor = t.BrickColor == BrickColor.new("Really black") and BrickColor.Random() or BrickColor.new("Really black")
if you want it to be black or random |
|
|
| Report Abuse |
|
|
Dwarlon
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 4604 |
|
|
| 14 Oct 2013 09:23 PM |
Hold up. I think you might have gotten it wrong.
I want it to be changing random automatically, but if you click it, it will stay only "Really black" Until you click it again, which will make it random.
Is there any way to make it where "Brickcolor.random" Exclude "Really Black"?
If I could do that, I could make it myself. |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2013 09:28 PM |
random = true t = script.Parent
function GetRandomColor() local = color = BrickColor.Random() if color == BrickColor.new("Really black") then color = GetRandomColor() end return color end
function startrandom() while random do wait(4) t.BrickColor = GetRandomColor() end end
t.ClickDetector.MouseClick:connect(function() random = not random if random then startrandom() end end)
|
|
|
| Report Abuse |
|
|
|
| 14 Oct 2013 09:29 PM |
i forgot to make the part black when random = false
random = true t = script.Parent
function GetRandomColor() local = color = BrickColor.Random() if color == BrickColor.new("Really black") then color = GetRandomColor() end return color end
function startrandom() while random do wait(4) t.BrickColor = GetRandomColor() end end
t.ClickDetector.MouseClick:connect(function() random = not random t.BrickColor = random and GetRandomColor() or BrickColor.new("Really black") if random then startrandom() end end) |
|
|
| Report Abuse |
|
|
Dwarlon
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 4604 |
|
|
| 14 Oct 2013 09:30 PM |
Okee Dokee. Haven't tested it, but it will most likely work.
+Respect since you're a 08'er +Respect since you were patient with me |
|
|
| Report Abuse |
|
|