My script is simple but causes this error
attempt to index local 'main' (a nil value)
My code is
if SERVER then
util.AddNetworkString("openmenu")
hook.Add("PlayerInitialSpawn","MGLUA_PlayerInitialSpawn_Identifier",function(ply)
net.Start("openmenu")
net.Send(ply)
end)
end
if CLIENT then
net.Receive("openmenu",function()
local main = vgui.Create("DFrame")
main:SetSize(1400,400)
main:SetTitle("")
main:Center()
end)
end
If this is not possible using this method, please let me know if there is another way to open a menu when a player spawns.