[SOLVED] Gamemode Help

Hello i am creating a Gamemode and i want a Menu that should open when the Player Joins the Server.

Here is the Code:

function OpemCharMenu()
   	local frame = vgui.Create("DFrame")
	frame:SetSize(ScrW() * 0.5, ScrH() * 0.5)
	frame:Center()
	frame:SetDraggable(false)
end

This is the File with the Menu (Filename: char_menu.lua)

include("shared.lua")
include("nng_hud.lua")
include("mygamemode/loader/loader.lua")
include("mygamemode/cl/char_menu.lua")

function GM:PlayerInitialSpawn( ply )
	OpemCharMenu()
end

And this is the cl_init.lua file

My Question is how do i make it that the Menu opens?
Thx for the help in advance

PlayerInitialSpawn isn’t called clientside so you have to make a network message from serverside. If you want to avoid this solution, you can always do this with gameevent.Listen function clientside.

1 Like

When i want to use PlayerInitialSpawn do i have to do it like

net.Start(...)
    OpenCharMenu()
net.Send(ply)

?

You can find some tutorials here:

2 Likes

thx