|
| 27 Nov 2011 08:01 AM |
Its annoying. I want it to change from Bright red to Bright green, but before it changes colors
b.Transparency = 0.1 wait(0.1) b.Transparency = 0.2 wait(0.1) b.Transparency = 0.3 wait(0.1) b.Transparency = 0.4 wait(0.1) b.Transparency = 0.5 wait(0.1) b.Transparency = 0.6 wait(0.1) b.Transparency = 0.7 wait(0.1) b.Transparency = 0.8 wait(0.1) b.Transparency = 0.9 wait(0.1) b.Transparency = 0.8 wait(0.1) b.Transparency = 0.7 wait(0.1) b.Transparency = 0.6 wait(0.1) b.Transparency = 0.5 wait(0.1) b.Transparency = 0.4 wait(0.1) b.Transparency = 0.3 wait(0.1) b.Transparency = 0.2 wait(0.1) b.Transparency = 0.1 wait(0.1) Then it would change to the next color.
b.Transparency = 0.1 wait(0.1) b.Transparency = 0.2 wait(0.1) b.Transparency = 0.3 wait(0.1) b.Transparency = 0.4 wait(0.1) b.Transparency = 0.5 wait(0.1) b.Transparency = 0.6 wait(0.1) b.Transparency = 0.7 wait(0.1) b.Transparency = 0.8 wait(0.1) b.Transparency = 0.9 wait(0.1) b.Transparency = 0.8 wait(0.1) b.Transparency = 0.7 wait(0.1) b.Transparency = 0.6 wait(0.1) b.Transparency = 0.5 wait(0.1) b.Transparency = 0.4 wait(0.1) b.Transparency = 0.3 wait(0.1) b.Transparency = 0.2 wait(0.1) b.Transparency = 0.1 wait(0.1)
Then change back to the first, and keep repeating. |
|
|
| Report Abuse |
|
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 27 Nov 2011 08:05 AM |
b = game.Workspace.brick --change to real name
for i=0.1, 0.9, 0.1 do b.Transparency = i end for i=0.8, 0.1, -0.1 do b.Transparency = i end b.BrickColor = BrickColor.new("Really red") for i=0.1, 0.9, 0.1 do b.Transparency = i end for i=0.8, 0.1, -0.1 do b.Transparency = i end b.BrickColor = BrickColor.new("Bright green") |
|
|
| Report Abuse |
|
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 27 Nov 2011 08:07 AM |
Opps, this:
for i=0.1, 0.9, 0.1 do b.Transparency = i wait(.1) end for i=0.8, 0.1, -0.1 do b.Transparency = i wait(.1) end b.BrickColor = BrickColor.new("Really red") for i=0.1, 0.9, 0.1 do b.Transparency = i wait(.1) end for i=0.8, 0.1, -0.1 do b.Transparency = i wait(.1) end b.BrickColor = BrickColor.new("Bright green") |
|
|
| Report Abuse |
|
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 27 Nov 2011 08:09 AM |
| But make sure you define b in the second one still... Also, whenever you have a giant line of code like that, it can 99% of the time be replaced by a for loop. |
|
|
| Report Abuse |
|
|
| |
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 27 Nov 2011 08:12 AM |
No..
b = game.Workspace.brick --Change brick to the name of the block you want the colours to change.
Also, this script shouldn't go in the block, just place it in Workspace. |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2011 08:13 AM |
| I know, when i run this all it does is spawn a random brick that only completes one circuit, and doesnt have the script in it. |
|
|
| Report Abuse |
|
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 27 Nov 2011 08:17 AM |
| My script shouldn't spawn a brick... |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Nov 2011 09:07 AM |
b = workspace.Brick --or whatever the name is
while wait() do for i = 0, 1, .1 do b.Transparency = i wait() end for i = 1, 0, -.1 do b.Transparency = i wait() end b.BrickColor = BrickColor.new("Bright red") for i = 0, 1, .1 do b.Transparency = i wait() end for i = 1, 0, -.1 do b.Transparency = i wait() end b.BrickColor = BrickColor.new("Bright green") end |
|
|
| Report Abuse |
|
|