0 Members and 1 Guest are viewing this topic.
function set_team() local frame = vgui.Create( "DFrame" ) frame:SetPos( ScrW() / 2, ScrH() / 2 ) frame:SetSize( 200, 210 ) frame:SetTitle( "Get Team!" ) frame:SetVisible( true ) frame:SetDraggable( false ) frame:ShowCloseButton( false ) frame:MakePopup() team_1 = vgui.Create( "DButton", frame ) team_1:SetPos( frame:GetTall() / 2, 5 ) team_1:SetSize( 80, 100 ) team_1:SetText( "Join a team!" ) team_1.DoClick = function() RunConsoleCommand( "team1" ) end endconcommand.Add("team_menu", set_team)
[gamemodes\dodgeball\gamemode\init.lua:60] attempt to index global 'vgui' (a nil value)
I'm not good at lua or anything but post the whole code maybe, and which is line 60? Maybe that will help to fix this error.
I still dont think its running clientside
UseG.AddCSLuaFile In your main init file with that file's name in it
Which line is number 60?
Line 60 is : local frame = vgui.Create( "DFrame" )And I have it under cl_spawnmenu.lua