IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 03 Apr 2013 11:36 AM |
Hi there, what's the simpler way to reduce / increase the transparency of a Frame within a ScreenGui, instead of having to type:
ScreenGui.Frame.BackgroundTransparency = 1 wait() ScreenGui.Frame.BackgroundTransparency = 0.9
etc etc.. |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
| |
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 03 Apr 2013 11:56 AM |
Does anyone know how to do it? I'm sure there is an easier way instead of having to type this:
script.Parent.Parent.Parent.Fade2.BackgroundTransparency = 1 wait() script.Parent.Parent.Parent.Fade2.BackgroundTransparency = 0.9 wait() script.Parent.Parent.Parent.Fade2.BackgroundTransparency = 0.8 wait() etc etc. |
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 03 Apr 2013 12:03 PM |
Could I have an example? would I have to do something like for i 1,10 do script.Parent.Parent.Parent.Fade2.BackgroundTransparency = i -0.1
|
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
|
| 03 Apr 2013 12:04 PM |
for i = 0, 1, 0.1 repeat FindPart.BackgroundTransparency = 1 - i until FindPart.BackgroundTransparency = 0 end |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 03 Apr 2013 12:06 PM |
| Well, I wanted it to minus 0.1 from the transparency so it returns back to 0, the transparency is set to 1, so minus 0.1 each time e.g. 1, 0.9, 0.8 etc. |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 03 Apr 2013 12:14 PM |
Is this correct?
function onClick() for i=1,10 do script.Parent.Parent.BackgroundTransparency = i *0.1 end end script.Parent.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 03 Apr 2013 12:16 PM |
Your not much help are you... how would I make it reduce transparency to 0 |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2013 12:18 PM |
Try the script I said a few posts ago?
Soup's on, everybody! |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 03 Apr 2013 12:20 PM |
What this:
function onClick() for i = 0, 1, 0.1 repeat FindPart.BackgroundTransparency = 1 - i until FindPart.BackgroundTransparency = 0 end script.Parent.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 03 Apr 2013 12:22 PM |
Wait, that script is missing a "do"
I'll test this though
function onClick() for i = 0, 1, 0.1 do repeat FindPart.BackgroundTransparency = 1 - i until FindPart.BackgroundTransparency = 0 end script.Parent.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
| |
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 03 Apr 2013 12:23 PM |
Nope, still don't work. What is the "FindPart" |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 03 Apr 2013 12:24 PM |
| Ah, I'll just do it the long way ha. |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2013 12:25 PM |
| Put the path to the GUI, for example script.Parent.Parent.Frame.TextButton |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2013 12:28 PM |
function onClick() for i = 0, 1, 0.1 do repeat script.Parent.Parent.Fade2.BackgroundTransparency = 1 - i until script.Parent.Parent.Fade2.BackgroundTransparency = 0 end end end |
|
|
| Report Abuse |
|
|
IceOrb
|
  |
| Joined: 02 May 2010 |
| Total Posts: 1206 |
|
|
| 03 Apr 2013 12:38 PM |
| 18:38:08.798 - Players.Player1.PlayerGui.ScreenGui.Frame.TextButton.Script:6: unexpected symbol near '=' |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2013 12:41 PM |
| Change the = on line 6 to == |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2013 12:44 PM |
function onClick() for i = 0, 1, 0.1 do repeat script.Parent.Parent.Fade2.BackgroundTransparency = 1 - i until script.Parent.Parent.Fade2.BackgroundTransparency == 0 end end
script.Parent.MouseButton1Click:connect(onClick)
|
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 03 Apr 2013 12:45 PM |
:l
No.
for i = 1, 0, -0.1 do script.Parent.Parent.Fade2.BackgroundTransparency = i end |
|
|
| Report Abuse |
|
|