moronmoo
|
  |
| Joined: 25 Nov 2011 |
| Total Posts: 1677 |
|
|
| 30 Jun 2012 11:19 PM |
Hey, all, I want to ask a question that may sound dumb, but how do you put multiple things in one script. I have two scripts in two script items, but I'd like to put two scripts in one script item. When I try to do that, the scripts don't work.
Here are my two scripts.
while wait(1) do Workspace.SignLight.BrickColor = BrickColor.Red() wait(1) Workspace.SignLight.BrickColor = BrickColor.Blue() end _________________________________________________________________________
while wait(1) do Workspace.Sign.BrickColor = BrickColor.Black() wait(1) Workspace.Sign.BrickColor = BrickColor.White() end
Any idea how to not use more than one script for it?
~I declare a thumb war. |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 30 Jun 2012 11:21 PM |
while wait() do Workspace.SignLight.BrickColor = BrickColor.new.Red() Workspace.Sign.BrickColor = BrickColor.new.Black() wait() Workspace.SignLight.BrickColor = BrickColor.new.Blue() Workspace.Sign.BrickColor = BrickColor.new.White() end |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 11:23 PM |
Have it under 1 while wait(1) do and 1 end. So, like this.
while wait(1) do Workspace.SignLight.BrickColor = BrickColor.Red() wait(1) Workspace.SignLight.BrickColor = BrickColor.Blue() Workspace.Sign.BrickColor = BrickColor.Black() wait(1) Workspace.Sign.BrickColor = BrickColor.White() end
~Clans fall, people don't~ |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 11:24 PM |
Copy and paste fail.. Anyway, use whatshisfaces(i dont like names)...
~Clans fall, people don't~ |
|
|
| Report Abuse |
|
|
DXPower
|
  |
| Joined: 21 Oct 2008 |
| Total Posts: 2866 |
|
|
| 30 Jun 2012 11:27 PM |
He wants two while loops your dingle-lings.
function while1() --While loop 1 here end function while2() --While loop 2 here end coroutine.resume(coroutine.create(while1)) coroutine.resume(coroutine.create(while2))
Coroutines allows multiple threads (Blocks of code) to run at the same time.
Wiki link:
http://wiki.roblox.com/index.php/Coroutines
Annoying the crap out of you, one word at a time. -Says suoicodilaipxecitsaligirfilacrepus repeatedly- |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 30 Jun 2012 11:27 PM |
I added a bit of typos in the last script:
while wait() do Workspace.SignLight.BrickColor = BrickColor.Red() Workspace.Sign.BrickColor = BrickColor.Black() wait() Workspace.SignLight.BrickColor = BrickColor.Blue() Workspace.Sign.BrickColor = BrickColor.White() end |
|
|
| Report Abuse |
|
|