Custom gamemodes don't work on servers.

I’ve been working on a custom gamemode, which works beautifully in single-player mode, but when I put it on a server to test, it doesn’t work at all. The weapons show up as ‘Scripted Weapon’ and none of the usual menus (e.g. the Q menu) work. Also, my custom HUD, which shows up in single-player mode, doesn’t show up either. When I load the scoreboard on single-player mode, it says it’s the sandbox mode (my gamemode is derived from sandbox) and on my server it says it uses base as the derivative (the scoreboard looks completely different). I’ve checked the gamemode directory and nothing seems to be out of sorts. What am I doing wrong here? I’ve tried a few different HUDS all with the same result. Even without the HUD this still happens despite me adding the code which says to derive from sandbox.

Sounds like you forgot AddCSLuaFile

I don’t think that’s the problem. In init.lua, I’ve got:

[lua]AddCSLuaFile( “cl_init.lua” )
AddCSLuaFile( “shared.lua” )[/lua]

cl_init.lua and shared.lua are the only files in the folder apart from init.lua.

Edit: Here’s cl_init.lua:
include( ‘shared.lua’ )

// Clientside only stuff goes here

function hidehud(name)
for k, v in pairs{“CHudHealth”, “CHudBattery”, “CHudAmmo”, “CHudSecondaryAmmo”} do
if name == v then return false end
hook.Add(“HUDShouldDraw”, “hidehud”, hidehud)

function hpbar()

local hp = (LocalPlayer():Health() * 3.2)
local thehealth = LocalPlayer():Health()
local middlex = (ScrW()/4) - 300
local bottomy = (ScrH()/4) * 3.8

draw.SimpleText( "Health", "MenuLarge", middlex - 74, bottomy - 20, Color(0, 0, 0, 255))
draw.RoundedBox( 6, middlex - 74, bottomy - 2, 320 + 10, 24, Color(0, 0, 0, 200) )

if thehealth <= 25 then
	draw.RoundedBox( 6, middlex - 70, bottomy + 3, hp, 15, Color(255, 0, 0, 200) )
elseif thehealth <= 50 then
	draw.RoundedBox( 6, middlex - 70, bottomy + 3, hp, 15, Color(255, 255, 0, 200) )
elseif thehealth <= 100 then
	draw.RoundedBox( 6, middlex - 70, bottomy + 3, hp, 15, Color(0, 255, 0, 200) )
draw.SimpleText(LocalPlayer():Health() .. "%", "MenuLarge", middlex + 90, bottomy + 10, Color(0, 0, 0, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)


hook.Add(“HUDPaint”, “hpbar”, hpbar)[/lua]

I’m working from the skeleton gamemode and a bunch of tutorials.

Well, we need a bit more to work with. The cl_init wouldn’t be causing any problems like what your describing. Check for errors, it will most likely say COULD NOT LOAD GAMEMODE somewhere in the server console.

cl_init.lua is the only file I have really edited in my gamemode so far, and I fixed all the errors where it said it couldn’t load the gamemode, so it did get loaded. It’s really confusing. :s

Edit: Well, after one or two days work, I finally got it working by stripping away lots of stuff from the server config file.