Basic Derma Issue

Ok so, haven’t Derma’d for ages but meh, i started with this.

[lua]
function shopderm()
mainf = vgui.Create(“DFrame”)

mainf:SetPos( ScrW()/2 , 10 )
mainf:SetSize( 500, 300 )
mainf:SetTitle( "Tsunami Shop" )
mainf:MakePopup()

end
concommand.Add(“shopframe”, shopderm)
[/lua]

If i do lua_openscript_cl shop.lua it starts it and says it’s running but tells me it doesn’t know the command shopframe and if i do lua_openscript it tells me vgui not a global or something, i know it’s not meant to be serverside but i tried it anyway. So yeah, tells me the command doesn’t exist. Halp!

It has to be clientside. So put it in cl_init, or another client file, and run it.

OP’s problem doesn’t make sense, even all his variables are globals(shrug) it should work perfectly fine, except OP has some conflicting addons installed or got more errors than he told us.

I know it’s clientside, hence why i ran lua_openscript_cl I’ll run it again for errors.

use this

[lua]
function shopderm()

local mainf = vgui.Create("DFrame")
mainf:SetPos( ScrW()/2 , 10 )
mainf:SetSize( 500, 300 )
mainf:SetTitle( "Tsunami Shop" )
mainf:MakePopup()

end
concommand.Add(“shopframe”, shopderm)[/lua]

It started working randomly, thanks anyway