Garry's Mod Wiki

gui.OpenURL

  gui.OpenURL( string url )

Description

Opens specified URL in the steam overlay browser.

When called clientside, user will be asked for confirmation before the website will open.

Arguments

1 string url
URL to open, it has to start with either http:// or https://.

Example

Opens a page when a button is clicked.

local button = vgui.Create( "DButton" ) button:SetSize( 125, 90 ) button:Center() button:SetText( "Join our Discord!" ) button.DoClick = function() gui.OpenURL( "https://discord.gg/gmod" ) end