|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
| |
|
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
|
  |
| 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
|
  |
| 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 |
|
|