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: How to put multiple things in one script?

Previous Thread :: Next Thread 
moronmoo is not online. 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 is not online. 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
LordSiphon is not online. LordSiphon
Joined: 28 May 2012
Total Posts: 518
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
LordSiphon is not online. LordSiphon
Joined: 28 May 2012
Total Posts: 518
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 is not online. 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 is not online. 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
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