Need help with removing and adding spawnmenu tabs

So i saw this thread today when i woke up and i thought that it would be a good idea to have on a server i help with so i have been messing around with this all day trying to make it work i cant get it to work. Can someone help me out?

My issue is when i join the server the tabs don’t disappear and the new tab wont create.

autorun:


if SERVER then
	AddCSLuaFile("tabChange.lua")
end

if CLIENT then
	
end

tab code:


newtabaddress = "http://rcted.com/forum/thread-3.html"
newtabname =  "Rules"
newtabicon = "icon16/control_repeat_blue.png"


local function removeOldTabls()
     for k, v in pairs( g_SpawnMenu.CreateMenu.Items ) do
        if (v.Tab:GetText() == language.GetPhrase("spawnmenu.category.npcs") or 
            v.Tab:GetText() == language.GetPhrase("spawnmenu.category.postprocess") or
            v.Tab:GetText() == language.GetPhrase("spawnmenu.category.dupes") or
            v.Tab:GetText() == language.GetPhrase("spawnmenu.category.saves")) then
            g_SpawnMenu.CreateMenu:CloseTab( v.Tab, true )
            --removeOldTabls()
        end
    end
end
hook.Add("SpawnMenuOpen", "blockmenutabs", removeOldTabls)



spawnmenu.AddCreationTab( newtabname , function()
	HTML = vgui.Create( "HTML" )
	HTML:OpenURL( newtabaddress )
	HTML:SetMouseInputEnabled(true)
	local DPanel = vgui.Create( "DPanel", HTML )
	local DButton = vgui.Create( "DButton", DPanel )
	DButton:SetText( "Back To Rules" )
	DButton:SizeToContents() 
	DButton:SetTall(DPanel:GetTall())
	DButton:SetDark( 1 )

	DButton.DoClick = function()
	HTML:OpenURL( newtabaddress )
	end
	return HTML , DPanel

end, newtabicon, 200 )


code from: http://forum.facepunch.com/showthread.php?t=1483637

What is the path to the file you put this code in, and what is the name of the file?

the autorun is in TabChange>lua>autorun
and the other file is in TabChange>lua
the name of the files are autorun.lua and tabChange.lua

Shouldn’t it be:



if SERVER then
	AddCSLuaFile("tabChange.lua")
end

if CLIENT then
	include("tabChange.lua") -- I think you forgot this
end


-snip- I got this all mixed up