How to call GUI to run with server side code

Hi, sorry to be that guy but I don’t know how to call gui to run on the screen with lua code, for example lets say I am making a capture the flag addon but when I run a command I only know how to get it to print in the chat and on the middle of the screen, not sure how to incorperate gui to pop up instead of a chat message.

Sorry if I’m not being very descriptive.

Sorry if I’m missing something but I 100% know how to code derma it’s just calling it with a command to pop up

Make a function that makes the derma popup. When the command is run call the function.

Like this



if (SERVER) then
   util.AddNetworkString("OpenVGUIElement")
   
   hook.Add("PlayerDeath", "ID", function(ply, inf, att) -- Would make a menu pop up when the player dies
      net.Start("OpenVGUIElement")
      net.Send( ply )
   end )
elseif (CLIENT) then
   net.Receive("OpenVGUIElement", function(len)
      OpenVGUIElement()
   end ) 

   function OpenVGUIElement()
      -- The vgui element code
   end
end


Just use network hooks to call the function to open it

I’m such an idiot lol, forgot you could network hook…thanks my man and thanks to txike. I’ll mark this as solved :slight_smile: