How Do I Make A Button Take You To The Options Menu?

So on my DarkRP server I have a script from Scriptfodder called 3DEscape which is as it’s titled, a 3D Escape Menu. Well, you can add buttons and stuff to it but I want to add a button that makes it so when you click it, it opens the menu where you can use your options like audio, video, etc. What would be the console command or code that I would associate with it to make that work? I will list the small part of code I need to know about and the link to the Scriptfodder script. (P.S. I would ask the developer but he isn’t answering my tickets so yeah.) (P.P.S. I also added the RunConsoleCommand( “gamemenucommand”, “openoptionsdialog” ) part in the function, that’s probably where I went wrong because clicking the button works, it just doesn’t appear on your screen unless you open the console then x out of console and it’s there, behind the game.)

Scriptfodder Link - 3D Escape: https://scriptfodder.com/scripts/view/1659/3d-escape-menu

Code Listed Below:


MENU:AddPanel( b )

local b = Button:New()
b:SetHeight( 48 )
b:SetText( "Settings" )

function b:Clicked()
	surface.PlaySound( "garrysmod/ui_click.wav" )
	RunConsoleCommand( "gamemenucommand", "openoptionsdialog" )
end

There’s nothing we can really do unless you show us a majority of the script. (Which you should not do)

You’re much better off contacting the script author for help or having a developer privately help you.


MENU:AddPanel( b )

local b = Button:New()
b:SetHeight( 48 )
b:SetText( "Settings" )

function b:Clicked()
	surface.PlaySound( "garrysmod/ui_click.wav" )
	gui.ActivateGameUI()
	RunConsoleCommand( "gamemenucommand", "openoptionsdialog" )
end

You’re on to something there. But assuming the custom menu hides the default menu and is toggled via the game menu being visible, that would only close the custom menu.

It’s OnClick, not Clicked iirc

Ok i’ll try what he said and se if it works.

[editline]12th November 2016[/editline]

UPDATE: I tried it and all I see is the menu pop-up for a short second then it just closes the escape menu, like you said. Any other ideas?

Anyone?

You can’t spawn options menu without spawning normal escape menu

ok is there at least a way to make the button take you to the main menu?

[editline]12th November 2016[/editline]

?

Try removing this
gui.ActivateGameUI()