|
| 05 Aug 2011 03:55 PM |
So I have a text button that's on my "main" GUI frame and what I'm trying to get it to do is once its clicked I want it to close the "main" frame(Frame1) and open the "New" frame (Frame). So here it is. I don't know why its not working.
local Button = script.Parent Frame = script.Parent.Parent.Parent.Level1Frame Frame1= script.Parent.Parent.SpellMenu
function onClick()
Frame1.Visible= false wait(0.1) Frame.Visible = true
end
Button.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2011 03:57 PM |
Try this:
script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.Parent.Level1Frame.Visible = true script.Parent.Parent.SpellMenu.Visible = false end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Aug 2011 03:59 PM |
| No need for more. If it still doesn't work, double check the paths to the two frames. |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2011 04:17 PM |
thanks this worked
script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.Parent.Level1Frame.Visible = true script.Parent.Parent.Parent.SpellMenu.Visible = false end)
I had to add another "Parent" to the 3rd line |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2011 04:18 PM |
| Ah. Well, I am sorry that I was unable to fix this...But I'm not able to go into your game in Edit mode... |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2011 04:35 PM |
| What do you mean? You fixed it lol |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2011 04:38 PM |
| I mean the parenting. I know I fixed it. YOU'D BEST GIVE ME COOKIEZ!! |
|
|
| Report Abuse |
|
|