DPropertySheet tab problem

Ok i just ran at a problem. The code worked fine before i added more tabs to it. After i added 2 tabs more it just errors this :



[ERROR] addons/kun_weaponsystem/lua/autorun/cl_kwepz.lua:174: attempt to index global 'wepprimary' (a nil value)
  1. func - addons/kun_weaponsystem/lua/autorun/cl_kwepz.lua:174
   2. unknown - lua/includes/modules/net.lua:31

This is the code :


		if((v.VIP == 1)) then
			weplvip:AddItem(wepp)
		elseif ((v.VIP == 0)) and ((v.Slot == 1 )) then
			wepprimary:AddItem(wepp)
		elseif ((v.VIP == 0)) and ((v.Slot == 2 )) then
			wepsecondary:AddItem(wepp)
		elseif ((v.VIP == 0)) and ((V.Slot == 3 )) then
			wepspecial:AddItem(wepp)
		end
	end
	
	PS1:AddSheet( "Primary", wepprimary, "gui/silkicons/user", false, false )
	PS1:AddSheet( "Secondary", wepsecondary, "gui/silkicons/user", false, false )
	PS1:AddSheet( "Specials", wepspecial, "gui/silkicons/user", false, false )
	PS1:AddSheet( "VIP", weplvip, "gui/silkicons/user", false, false )

The function “wepprimary” doesn’t exist.

[editline]14th October 2013[/editline]

What, what line is 174?

Line 174 is :


			wepprimary:AddItem(wepp)

Well, where are you defining wepprimary?

No where other then adding a sheet. Does it require more?