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: Fade code

Previous Thread :: Next Thread 
link7002 is not online. link7002
Joined: 26 May 2009
Total Posts: 545
03 Mar 2012 09:06 AM
while true do
wait(1)
script.Parent.BackgroundTransparency = - 0.1
end


I want the code to make the BackgroundTransparency ( Of a frame ) fade in.

I wasn't quite sure how to do this, however. This code just makes the background transparency -0.1.
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
03 Mar 2012 09:09 AM
Yes of course link!

This is a SET script. What you need is like, you need the ORIGINAL value being -1'd right?

So you do this!

while true do
wait(1)
script.Parent.BackgroundTransperency = script.Parent.BackgroundTransperency - 0.1
end

To make it more smooth do

while true do
wait(0.1)
script.Parent.BackgroundTransperency = script.Parent.BackgroundTransperency - 0.01
end
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
03 Mar 2012 10:37 AM
You sure you want a while loop?

for i = 1,0,-.1 do
wait(1)
script.Parent.BackgroundTransparency = i
end

Not sure if you want the while loop cause that'll repeat forever, making the gui be visible or invisible and still running.
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
03 Mar 2012 10:57 AM
Argh oops! :)

Normally i do this yes. I need to work on my for loops.

I normaly do then if BackgroundTransperency == 1 then break end
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
03 Mar 2012 11:29 AM
That would be useless or not useless depending on how long your for loop runs.
Report Abuse
link7002 is not online. link7002
Joined: 26 May 2009
Total Posts: 545
03 Mar 2012 01:30 PM
Thanks guys! I started using python for a bit, so now I'm all messed up with lua! Rofl
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
03 Mar 2012 01:31 PM
Ah good ol python.
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