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 » Scripters
Home Search
 

Re: Need help with this Change BrickColor script.

Previous Thread :: Next Thread 
mikkjal134 is not online. mikkjal134
Joined: 13 Aug 2009
Total Posts: 1289
23 Jul 2015 01:52 AM
The script is this.
while true do
x = game.Workspace.BRICK
x.BrickColor = BrickColor.new(1011)
wait(0.1)
x.BrickColor = BrickColor.new(1)
wait(0.1)
x.BrickColor = BrickColor.new(104)
wait(0.1)
x.BrickColor = BrickColor.new(140)
wait(0.1)
x.BrickColor = BrickColor.new(141)
wait(0.1)
x.BrickColor = BrickColor.new(26)
wait(0.1)
x.BrickColor = BrickColor.new(1015)
wait(0.1)
end

What I want to be able to know is how to make so that I dont have to change the name of every brick. The "x = game.Workspace.BRICK" is what I want to know how to change. Is it possible to change it to "x = Parent" or something like that?
Report Abuse
superinternetman is not online. superinternetman
Joined: 17 Feb 2011
Total Posts: 1957
23 Jul 2015 02:02 AM
Set x equal to script.Parent like so

x = script.Parent

Then copy that script and set it as the child for as many bricks as you want.
Report Abuse
MetroidManiac is not online. MetroidManiac
Joined: 05 Jun 2008
Total Posts: 305
23 Jul 2015 02:02 AM
It's kind of hard to understand what you're asking... Perhaps you should start with coding more efficiently. Use this:

x = workspace.BRICK;
colors = {1011, 1, 104, 140, 141, 26, 1015};
while true do
for _, n in pairs (colors) do
x.BrickColor = BrickColor.new (n);
wait (0.1);
end;
end;

Are you asking how to change the color of the brick's parent too?
Report Abuse
mikkjal134 is not online. mikkjal134
Joined: 13 Aug 2009
Total Posts: 1289
23 Jul 2015 02:14 AM
@ superinternetman
Thanks! It worked.

@ MetroidManiac
The question was how to change "x = game.workspace.[the parts name]" in a way that I wouldn't need to change every parts name to be able to get the script running.
Report Abuse
superinternetman is not online. superinternetman
Joined: 17 Feb 2011
Total Posts: 1957
23 Jul 2015 02:15 AM
no problemo
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
23 Jul 2015 02:16 AM
TimeTicks will be here
Report Abuse
gooey333 is not online. gooey333
Joined: 24 Mar 2013
Total Posts: 1208
23 Jul 2015 02:18 AM
Is that suppose to be good? TimeTicks posts hate comments on everything I do!
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
23 Jul 2015 02:24 AM
Lol ikr TimeTicks is just a stupid skid that bullies everyone.

jkjk <3 TimeTickz

(not rlly)

but liek, @OP.. Roblox Lua is based around the Parent-Child relationship - whereas to index the "self", or object that's running the thread then you would use the keyword 'script'. So, with said Parent-Child relationship.. "script.Parent".
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
23 Jul 2015 02:59 AM
GOULSTEM I LOVE YOU TOO BBY <333


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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