Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

GUI Visible help?

Asked by 9 years ago
local par = script.Parent.Parent.Parent.Parent
local Table = {
    par.Developers.TextButton,
    par.News.TextButton,
    par.Exit.TextButton,
    par.Play.TextButton,
    par.UpdateLog.TextButton,
    }

script.Parent.MouseButton1Click:connect(function()
    par.updateloginfo.TextLabel.Visible = false
end)
    for i=1,#Table, 1 do
        Table[i].Visible=true
    end

When I press "Update Log" it hides Play, Update Log, Exit, News and Developers. Thats what I want but when I put a back back button on updateloginfo it hides the TextLabel which is what i want but it doesnt show the Main Menu. Help?

0
This is easy but it's still too broad. Tell us the family tree. EzraNehemiah_TF2 3552 — 9y

1 answer

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
9 years ago

There seems to be missing code here, since that appears to only be your 'back' button.

The reason this code doesn't work is because you loop through the Table outside of the function connection to the mouse click. What this means is that that loop only ever runs once: when the script is first run by the Server.

To fix that, simple put the loop inside of the function:


local par = script.Parent.Parent.Parent.Parent local Table = { par.Developers.TextButton, par.News.TextButton, par.Exit.TextButton, par.Play.TextButton, par.UpdateLog.TextButton, } script.Parent.MouseButton1Click:connect(function() par.updateloginfo.TextLabel.Visible = false for i=1,#Table, 1 do Table[i].Visible=true end end)
Ad

Answer this question