I am making a vgui menu for a gamemode I am making, and I decided to start off with a test vgui. It is very simple, it has no buttons, just a box with a title. But when I loaded the gamemode, it said that it attempted to index global 'vgui' (a nil value) Now I posted a thread on this yesterday, but it semss that the category for gmod that I put it in is missing. AND the guy who responded, just said I was running a cl_init.lua command with serverside, but I have no idea how to fix it. Here is my code:
init.lua:
[CODE]AddCSLuaFile( "shared.lua" )
AddCSLuaFile( "cl_init.lua" )
include( "shared.lua" )
function GM:PlayerInitialSpawn( ply )
ply:SetTeam( 1 )
ply:Give( "weapon_pistol" )
ply:GiveAmmo( 100, "pistol" )
end
function GM:PlayerSpawn( ply )
ply:SetTeam( 1 )
ply:Give( "weapon_pistol" )
ply:GiveAmmo( 100, "pistol" )
end
function GM:PlayerLoadout( ply )
end
concommand.Add( "buy", buy_list )[/CODE]
shared.lua:
[CODE]GM.Name = "badmoney"
GM.Author = "HERPS THE DERPS"
GM.Email = "LULZ@LULZ.LULZ"
GM.Website = "www.LULZ.co.uk.edu.org.com"
GM.TeamBased = false
team.SetUp(1, "Player", Color(125, 125, 125, 255))[/CODE]
cl_init.lua:
[CODE]include( "shared.lua" )
local function buy_list()
local menu = vgui.Create( "DFrame" )
menu:SetPos( 100, 100 )
menu:SetSize( 300, 200 )
menu:SetTitle( "My new Derma frame" )
menu:SetVisible( true )
menu:SetDraggable( true )
menu:ShowCloseButton( true )
menu:MakePopup()
end
end[/CODE]
Thank you so much to anyone who responds!!!
P.S. ADMINS ATTENTION: I know this is a repost, it's just that the category is gone that I posted the other one in, at least it is for me, so PLEASE don't ban me! Thank you!
-- Kimzey