What is wrong with this line of code?

Wtf is wrong with it that is stopping it from showing up? One day the tool just stopped working and there wasnt even a garrys mod update so this is the error…
[ERROR] addons/smart_welding/lua/autorun/smartwelder.lua:1: attempt to index global ‘TOOL’ (a nil value)

  1. unknown - addons/smart_welding/lua/autorun/smartwelder.lua:1

And that line of code is:


TOOL.Category	= "Constraints"               --This is line 1
TOOL.Name			= "#Weld - Smart"
TOOL.Command		        = nil
TOOL.ConfigName		= ""
TOOL.busy                        =false


TOOL is nil.

So should i change it

Posting a few lines of code and saying “why doesn’t it work” is like showing us 1 line of a book and asking us if the book’s any good

[editline]28th December 2012[/editline]

Well actually in this case it’s the start of the code so I’ll be quiet
I’m not sure, but I’d imagine you need a TOOL = {} before the first line. It’s trying to access TOOL, but it hasn’t been defined yet

Well why would that be the case if all the time before it worked? I sudently stopped working and there wasnt even a garrys mod update to change anything. Also no other addons where updated, downloaded, changed, or removed

Your tool is in the wrong path. They should be in weapons/gmod_tool/stools.