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: Help with this script.

Previous Thread :: Next Thread 
DeepFreeze is not online. DeepFreeze
Joined: 10 May 2008
Total Posts: 7162
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 is not online. 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 is not online. 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 is not online. 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
DeepFreeze is not online. DeepFreeze
Joined: 10 May 2008
Total Posts: 7162
27 Nov 2011 08:10 AM
b=brick
Report Abuse
NeonBlox is not online. 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
DeepFreeze is not online. DeepFreeze
Joined: 10 May 2008
Total Posts: 7162
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 is not online. NeonBlox
Joined: 19 Oct 2008
Total Posts: 1462
27 Nov 2011 08:17 AM
My script shouldn't spawn a brick...
Report Abuse
DeepFreeze is not online. DeepFreeze
Joined: 10 May 2008
Total Posts: 7162
27 Nov 2011 08:19 AM
I know, but it does.
Report Abuse
Lightmaster9 is not online. Lightmaster9
Joined: 14 May 2009
Total Posts: 8659
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
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