I'm trying to make a custom F1 with the show help hook but I can't seem to get it to work. I just get script errors.
hook.Add( "ShowHelp", "mainmenu", function( ply )
local frame = vgui.Create( "DFrame" )
frame:SetSize( 1100, 800 )
frame:Center()
frame.OnClose = function() ply:PrintMessage(HUD_PRINTTALK, "You can reopen this menu by doing !mainmenu" ) end
frame.Paint = function()
frame:SetVisible( true )
surface.SetDrawColor(0, 97, 255)
surface.DrawRect( 0, 0, frame:GetWide(), frame:GetTall() )
surface.SetDrawColor( 255, 0, 0)
surface.DrawOutlinedRect( 0, 0, frame:GetWide(), frame:GetTall() )
end
Any help?
hook.Add( "ShowHelp", "mainmenu", function( ply )
local frame = vgui.Create( "DFrame" )
frame:SetSize( 1100, 800 )
frame:Center()
frame.OnClose = function()
ply:PrintMessage(HUD_PRINTTALK, "You can reopen this menu by doing !mainmenu")
end
frame.Paint = function(s,w,h)
surface.SetDrawColor(0, 97, 255)
surface.DrawRect( 0, 0, w, h )
surface.SetDrawColor( 255, 0, 0)
surface.DrawOutlinedRect( 0, 0, w, h )
end
end)
Try this, you were missing an end for the hook
I made the change but it still doesn't seem to work?
It would be helpful if you post the errors you get
Sorry, you need to Log In to post a reply to this thread.