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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|