|
| 11 Sep 2013 11:03 PM |
I need help writing a script. I need the script to automatically change the color of the brick, from Really Red to Lime Green, and then back, and have it set to an infinite loop so that it keeps changing
This i what I have. I know it doesn't work, but I need to know how I could write it to make it work.
local brick = script.Parent
if brick.BrickColor = ("Really Red") then brick.BrickColor = BrickColor.new("Lime green") wait(1) brick.BrickColor = BrickColor.new("Really red") end |
|
|
| Report Abuse |
|
|
|
| 11 Sep 2013 11:07 PM |
local brick = script.Parent
if brick.BrickColor = ("Really Red") then--needs '==' when comparing 2 values; It's "Really red" brick.BrickColor = BrickColor.new("Lime green") wait(1) brick.BrickColor = BrickColor.new("Really red") end |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Sep 2013 06:18 PM |
It still doesn't work, even with what you told me, ScrewDeath.
And any way that I can get it to work, only makes it work once, then it stops. |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2013 06:22 PM |
while true do script.Parent.BrickColor = BrickColor.new(21)--red wait(1.) script.Parent.BrickColor = BrickColor.new(106)--organge wait(.1) script.Parent.BrickColor = BrickColor.new(24)--yellow wait(.1) script.Parent.BrickColor = BrickColor.new(28)--green wait(.1) script.Parent.BrickColor = BrickColor.new(23)--blue wait(.1) script.Parent.BrickColor = BrickColor.new(104)--purple wait(.1) end
There are a few colors work with it you can change Wait() to the time that you want in between changes you can also make it loop on one color again your choice.
|
|
|
| Report Abuse |
|
|
|
| 12 Sep 2013 06:23 PM |
| I know it's a diffrent way just work with meh. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 12 Sep 2013 06:24 PM |
local brick = script.Parent
while Wait(1) do brick.BrickColor = brick.BrickColor == BrickColor.new("Really red") and BrickColor.new("Lime green") or BrickColor.new("Really red") end |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2013 07:19 PM |
if P1 == nil and P2 == nil then P1 = Instance.new("Part", Char) P1.Name = "P1" P1.Size = Vector3.new(0,0,1) P1.Shape = Config.Shape P1.BrickColor = BrickColor.new(math.random(), math.random(), math.random()) P1.Material = Config.Material P1.TopSurface = "Smooth" P1.BottomSurface = "Smooth" P1.Position = Char.Torso.Position P1.CanCollide = false
---
How do I makeP1.BrickColor = BrickColor.new(math.random(), math.random(), math.random()) into a color loop ( the part, P1 and P2) without breaking the script? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 12 Sep 2013 07:20 PM |
BrickColor.Random()
ohaider c; |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2013 07:21 PM |
| Would it be a 'while' statement? sorry for my mis-knowledge of loops. |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2013 07:23 PM |
hi cnt :> and not what I mean, I don't know how to make Parts flash colors repeatively like a simple example: while true do game.lighting.ambient=color3.random() wait(0); end
does this apply the same to making a part loop in colors like you can with ambient? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 12 Sep 2013 07:24 PM |
You can do:
BrickColor.Random().Color
It will return the Color3 value of a BrickColor |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2013 07:57 PM |
| Thank you! cntkillme! :D Your script works! |
|
|
| Report Abuse |
|
|