generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Color Changing brick Script help

Previous Thread :: Next Thread 
JohnnyFenson is not online. JohnnyFenson
Joined: 18 Sep 2012
Total Posts: 20
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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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
laughablehaha is not online. laughablehaha
Joined: 19 Apr 2012
Total Posts: 2495
12 Sep 2013 06:17 AM
To mama


;)
Report Abuse
JohnnyFenson is not online. JohnnyFenson
Joined: 18 Sep 2012
Total Posts: 20
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
coolhighpower is not online. coolhighpower
Joined: 28 Jun 2011
Total Posts: 214
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
coolhighpower is not online. coolhighpower
Joined: 28 Jun 2011
Total Posts: 214
12 Sep 2013 06:23 PM
I know it's a diffrent way just work with meh.
Report Abuse
cntkillme is not online. 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
HOTawesumKiD is not online. HOTawesumKiD
Joined: 10 Dec 2010
Total Posts: 120
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 is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Sep 2013 07:20 PM
BrickColor.Random()

ohaider c;
Report Abuse
HOTawesumKiD is not online. HOTawesumKiD
Joined: 10 Dec 2010
Total Posts: 120
12 Sep 2013 07:21 PM
Would it be a 'while' statement? sorry for my mis-knowledge of loops.
Report Abuse
HOTawesumKiD is not online. HOTawesumKiD
Joined: 10 Dec 2010
Total Posts: 120
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 is not online. 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
JohnnyFenson is not online. JohnnyFenson
Joined: 18 Sep 2012
Total Posts: 20
12 Sep 2013 07:57 PM
Thank you! cntkillme! :D Your script works!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image