It depends what you need it for one is for each player then use a local script and enter
Button.MouseButton1Click:connect(function(onClick)
end)
But if the survivial menu is going to change depending on players options for all players then use
events. You probably should also make 1 button open the frame and in that frame there is a button to close the frame.
If you need code that is complete or you have any questions or even want to correct me then feel free to do so :)
Edited:
Well. As I said it really depends what you need the GUI for. As I understand survival menu won't change any values/text depending on players right? (correct me if im wrong) so all you need to do is make a button, a frame for the survival menu, in the survival menu/frame make another button. Now inside the first button which will open up your GUI/Survivalmenu/Frame put the script I put in my answer.
Inside the function I wrote for you make something like this:
local Frame = game.StarterGui.SurvivalMenu.Frame
local ButtonOpen = game.StarterGui.SurvivalMenu.Open
local ButtonClose = game.StarterGui.SurvivalMenu.Frame.Close
ButtonOpen.MouseButton1Click:connect(function(onClick)
Frame.Visible = true
end)
Now you got the open button working. Now we need a scirpt that will close is.
The close button is in the frame that is showing if we click the first button the OpenButton.
The following code needs to be inside the close button.
ButtonClose.MouseButton1Click:connect(function(onClick)
Frame.Visible = false
end)
I beleve thats all we need for the frame/survival menu to show.
If I understood the usage of the SurvivalMenu wrong or I described the function to complicated tell me and I'll fix all of this and do it in a more simple way :)
[If anyone wants to correct me feel free to do so since I make mistakes sometimes :P]
3 comments
You probably use a serverscript, you should use a local script
i have a local in my imagebutton which has that code but it won't work in-game and im not sure why, thanks for the help though
I updated my description but if you don't want to make this many scirpts use your current one and put it inside a local script. But I recommend making 2 scirpt one to open the gui and one to close it :)