Derma, Trying using hooks to have more complicated tab sheet

I’m not sure this is actually how your supposed to do it, but theoretically, to me atleast, it seems it should work. I wanted to do more complicated things on my tab sheets so I hooked the variable that is called for the sheet with another function with derma instructions.

I’m not sure whether this is an error with design or simple grammatical error because I’ve never tried this before. If it’s the first, can you suggest a better way to do this?

error message:

[gamemodes\skeleton\gamemode\cl_init.lua:55] '(' expected near 'local'


 Warning: Unhandled usermessage 'call_vgui'

[lua]include( ‘shared.lua’ )

// Clientside only stuff goes here
function ShowTeamMenu()
local DermaPanel = vgui.Create( “DFrame” ) – Creates the frame itself
DermaPanel:SetPos( 80,80 ) – Position on the players screen
DermaPanel:SetSize( 800, 600 ) – Size of the frame
DermaPanel:SetTitle( “Main Menu” ) – Title of the frame
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( false ) – Draggable by mouse?
DermaPanel:ShowCloseButton( true ) – Show the close button?
DermaPanel:MakePopup() – Show the frame

local TestingPanel = vgui.Create( “DPanel”, DermaPanel )
TestingPanel:SetPos( 25, 50 )
TestingPanel:SetSize( 750, 50 )
TestingPanel.Paint = function() – Paint function
surface.SetDrawColor( 50, 50, 50, 255 ) – Set our rect color below us; we do this so you can see items added to this panel
surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() ) – Draw the rect
surface.DrawText( “Message of the Day: Zyler Rocks!” )

local PropertySheet = vgui.Create( “DPropertySheet” )
PropertySheet:SetParent( DermaPanel )
PropertySheet:SetPos( 25, 110 )
PropertySheet:SetSize( 750, 315 )

local Welcome = umsg.Start( “WelcomeSheet”, ply )

local Character = vgui.Create( “DLabel” )
Character:SetText( “B” )

local Props = vgui.Create( “DLabel” )
Props:SetText( “C” )

PropertySheet:AddSheet( “Welcome”, Welcome, “gui/silkicons/user”, false, false, “Rules and stuff” )
PropertySheet:AddSheet( “Character/Groups”, Character, “gui/silkicons/group”, false, false, “Manage your character and groups” )
PropertySheet:AddSheet( “Props/Tools”, Props, “gui/silkicons/group”, false, false, “Get Props and Tools” )


usermessage.Hook( “call_vgui”, ShowTeamMenu )

function WelcomeSheet
local WelcomeSheet = vgui.Create( “DLabel” )
WelcomeSheet:SetText( “A” )

usermessage.Hook( “WelcomeSheet”, WelcomeSheet )


umsg.Start doesn’t return anything, so you don’t need to do [lua]local Welcome = umsg.Start( “WelcomeSheet”, ply )[/lua]

Edit: Hold on, why are you sending usermessages clientside?

also [lua]function WelcomeSheet[/lua] should be [lua]function WelcomeSheet()[/lua]