attempt to index global 'value' (a nil value)

I’ve just gotten into Lua scripting, and am creating my own gamemode. But, I’ve got a problem. Say for example I wrote this code:
local client = LocalPlayer()
local draw = draw
local vgui = vgui

I would get this error: attempt to index global ‘draw’ (a nil value)
‘draw’ could also be ‘vgui’, ‘LocalPlayer’, or anything else like that.

So what’s the problem? Sorry if the answer is really simple, but I’ve just gotten into Lua and am not quite sure what the problem is or how to fix it.

You’re running it serverside.

[editline]12th May 2013[/editline]

As in, the LocalPlayer() function, draw library and vgui library are all clientside.

Oh. That would explain a bunch. So I don’t ‘include’ the file in the init.lua file, but I ‘include’ it in the cl_init.lua one?

Since you are new, I recommend you start small first. With little addons for another game mode or something of that nature. If you try to make a game mode when you are really new, you’re probably going to fail.

I disagree with that ben434, making a gamemode is probably one of the best things you can do (depending on the complexity of the goal of course) when you are new. It gives you a whole new understanding of the server and client relationship and as such, I can only recommend it.