IRyan70
|
  |
| Joined: 08 Jun 2011 |
| Total Posts: 484 |
|
|
| 16 Aug 2014 03:54 PM |
Say i have a gui frame "m2" and i want all the objects in m2 to fade there transparency. I was gonna use a loop, and i know getchildren makes a table with all of the children, but how do i call the table? Like... for _ = 1, #TableNameHere do end blah blah But how do i know what the tables name is or how do i set it?
Do i do m2:GetChildren(Table1) --? |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2014 03:55 PM |
| If you use ":GetChildren()", it returns the table of the object. |
|
|
| Report Abuse |
|
|
IRyan70
|
  |
| Joined: 08 Jun 2011 |
| Total Posts: 484 |
|
|
| 16 Aug 2014 03:57 PM |
| Ok so how can i make all the text labels in m2 into Transparency 0? But fading |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2014 03:59 PM |
You could try using something such as, for _ = 1, #TableNameHere:GetChildren() do if TableNameHere[_].ClassName == "TextLabel" then --More Code Here end end
|
|
|
| Report Abuse |
|
|
IRyan70
|
  |
| Joined: 08 Jun 2011 |
| Total Posts: 484 |
|
|
| 16 Aug 2014 04:09 PM |
Error- 1 is not a valid member of Frame I guess the error is on "THISLINE"
pl.MouseButton1Click:connect(function() for _ = 1, #m2:GetChildren() do if m2[_].ClassName == "TextLabel" or m2[_].ClassName == "TextButton" then--THISLINE m2[_].BackGroundTransparency = m2[_].BackGroundTransparency + 0.1 wait(0.1) end end end)
PS-m2 is the frame with the labels and buttons |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2014 04:17 PM |
Alternatively, for v,_ in pairs(m2:GetChildren()) do if _.ClassName == "TextLabel" or _.ClassName == "TextButton" then _.BackGroundTransparency = _.BackgroundTransparency + 0.1 wait(0.1) end end |
|
|
| Report Abuse |
|
|
IRyan70
|
  |
| Joined: 08 Jun 2011 |
| Total Posts: 484 |
|
|
| 16 Aug 2014 04:22 PM |
| Ok so it works, but i need to click once, and it makes them fully invisible |
|
|
| Report Abuse |
|
|
| |
|
IRyan70
|
  |
| Joined: 08 Jun 2011 |
| Total Posts: 484 |
|
|
| 16 Aug 2014 05:02 PM |
| No no its like i have to click play 10 times to make it invisible |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Aug 2014 05:12 PM |
Actually you could try something such as, for i = _.Transparency,1 do wait(1) _.Transparency = _.Transparency+0.1 end |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
|
| 16 Aug 2014 05:13 PM |
clicked = 0 pl.MouseButton1Click:connect(function() clicked = clicked+1 if clicked == 10 then for _ = 1, #m2:GetChildren() do if m2[_].ClassName == "TextLabel" or m2[_].ClassName == "TextButton" then--THISLINE m2[_].BackGroundTransparency = m2[_].BackGroundTransparency + 0.1 wait(0.1) end end end end) |
|
|
| Report Abuse |
|
|
IRyan70
|
  |
| Joined: 08 Jun 2011 |
| Total Posts: 484 |
|
|
| 16 Aug 2014 06:47 PM |
| I only want to click the play button once, and all the children of m2 (a frame) slowly turn invisible (transparent) |
|
|
| Report Abuse |
|
|
IRyan70
|
  |
| Joined: 08 Jun 2011 |
| Total Posts: 484 |
|
| |
|
|
| 17 Aug 2014 09:48 AM |
Make it so that it runs a for loop after you've clicked it once.
script.Parent.MouseButton1Down:connect(function() --or whatever you're using for whatever blah end end) |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
| |
|