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: Do Something for a certain amount of time?

Previous Thread :: Next Thread 
Supah is not online. Supah
Joined: 16 Aug 2008
Total Posts: 921
14 Dec 2012 05:03 PM
say do This

Path.BrickColor = BrickColor.Random()
for 20 seconds.
Would this be
for(20) do
or what?
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
14 Dec 2012 05:05 PM
wait(20)
or:
delay(function,20()
something
end)

For hippies: http://www.roblox.com/Peace-Shirt-TRANSPARENT-item?id=99429853
Report Abuse
Supah is not online. Supah
Joined: 16 Aug 2008
Total Posts: 921
14 Dec 2012 05:06 PM
wait(20) would wait 20 seconds BEFORE doing this, but I want it to make the BrickColor change randomly for 20 seconds.
Report Abuse
Jonah13249 is not online. Jonah13249
Joined: 09 Oct 2009
Total Posts: 2105
14 Dec 2012 05:09 PM
brick = script.Parent -- Change to Brick

while wait(20) do
brick.BrickColor = BrickColor.Random()
end

~ṡсɾïρτïṉģ hεlρεɾṡ ۩ lυαlεαɾṉεɾṡ ④ øƒвќṃṿј~ ღ ▂▃▅▆█ρεώḋïερïε☄сυτïερïε█▆▅▃▂ღ 【▬】
Report Abuse
jelly134 is not online. jelly134
Joined: 25 Aug 2008
Total Posts: 1137
14 Dec 2012 05:12 PM
for i=1, 20 do
Path.BrickColor = BrickColor.Random()
wait(1)
end
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
14 Dec 2012 05:13 PM
No no Jon, he want's to make the brick change color for 20 seconds, not after 20 seconds.
You need a for loop,

for n=1,20,1 do
brick.BrickColor = BrickColor.Random()
wait(1) end
Report Abuse
Supah is not online. Supah
Joined: 16 Aug 2008
Total Posts: 921
14 Dec 2012 05:14 PM
Okay, here's something that should explain better. I'm working on a "Disco" part for my house script.
elseif string.lower(msg) == "disco" then
while wait(2) do
Wall1.BrickColor = BrickColor.Random()
Wall2.BrickColor = BrickColor.Random()
Wall3.BrickColor = BrickColor.Random()
Wall4.BrickColor = BrickColor.Random()
Wall5.BrickColor = BrickColor.Random()
Roofzz.BrickColor = BrickColor.Random()
Floor.BrickColor = BrickColor.Random()
Path.BrickColor = BrickColor.Random()
end
When I say disco, it needs to change colors every 2 seconds for a total of 20 seconds, then stop changing brick colors.
What would do this?
Report Abuse
jelly134 is not online. jelly134
Joined: 25 Aug 2008
Total Posts: 1137
14 Dec 2012 05:16 PM
elseif string.lower(msg) == "disco" then
for i=1,20,2 do
Wall1.BrickColor = BrickColor.Random()
Wall2.BrickColor = BrickColor.Random()
Wall3.BrickColor = BrickColor.Random()
Wall4.BrickColor = BrickColor.Random()
Wall5.BrickColor = BrickColor.Random()
Roofzz.BrickColor = BrickColor.Random()
Floor.BrickColor = BrickColor.Random()
Path.BrickColor = BrickColor.Random()
wait(2)
end
end
Report Abuse
Supah is not online. Supah
Joined: 16 Aug 2008
Total Posts: 921
14 Dec 2012 05:16 PM

Nevermind, I see the fix now.
Thank you all!

~What's green and has wheels? Grass, I've lied about the wheels.~
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