Need help on my gamemode!


I’m working on a gamemode to my server, NoR-ST.

Basic info:
NoR is my clan tag, Norway’
ST is Starship Troopers

It’s nothing big, just a simple gamemode, with some diffrent classes, such as Civilian, Soldier, Support, Medic, Engineer, Sniper and Pilot.

What I need help with:

I can’t get the gamemode to run, when I play it, there is no classes. and the Tab meny says it’s Gamemode Base or something, and it’s made by Garry, witch has nothing to do with my gamemode.
Any ideas on how to fix this? I can’t find anything wrong in my LUS files… I have even compared it to other gamemodes, similar to mine, but still… can’t find the problem. it’s like the gamemode won’t load wehn I play it.

Add me on Steam if you can help, then I send you the details.

Steam name: Major John
Steam page:

Thank You!

This means there is an error that is preventing the init.lua from properly running. Check your console, it should say something along the lines of *** CANNOT LOAD GAMEMODE ***. Beneath that (or above it) should be an error message. That’s what your problem is.

In-Game console says:

 Couldn't include file 'NoR-ST/gamemode/cl_init.lua' (File not found)
********** COULDN'T LOAD GAMEMODE!! **********

There was a problem opening the gamemode file 'NoR-ST/gamemode/cl_init.lua'

And server console says:

-- Error SENDING CLIENTSIDE file -------------------------
- File Not Found: cl_init.lua

So I’m guessing there is something wrong with my cl_init.lua?


I think I might know the problem now,

AddCSLuaFile( "cl_init.lua" ) --Tell the server that the client needs to download cl_init.lua
AddCSLuaFile( "shared.lua" ) --Tell the server that the client needs to download shared.lua
include( 'shared.lua' ) --Tell the server to load shared.lua

I need to include “cl_init.lua” too, same as “shared.lua”. Right? I’m going to try that, Thanks!

Edit V2:

Nope, it didn’t work… lol, I’m not very good with LUA.
Anyone know hoe to fix this?

  1. Don’t include cl_init serverside.
  2. Do you have a cl_init.lua?
  1. What? I have cl_init.lua in garrysmod\gamemodes\NoR-ST\gamemode, in the same folder with init.lua and shared.lua.
  2. Yes, I do have have a cl_init.lua

should I paste my cl_init.lua here, so you can take a look? I’m not sure if that is smart… lol

This is my cl_init.lua

include( 'shared.lua' ) --Tell the client to load shared.lua


function set_team()
local frame = vgui.Create( "DFrame" )
frame:SetPos( ScrH() / 2, ScrW() / 2 ) --Set the window in the middle of the players screen/game window
frame:SetSize( 200, 210 ) --Set the size
frame:SetTitle( "Change Class" ) --Set title
frame:SetVisible( true )
frame:SetDraggable( false )
frame:ShowCloseButton( true )

-- Team 1 "Civilian"
team_1 = vgui.Create( "DButton", frame )
team_1:SetPos( frame:GetTall() / 2, 5 ) --Place it half way on the tall and 5 units in horizontal
team_1:SetSize( 50, 100 )
team_1:SetText( "Civilian" )
team_1.DoClick = function() --Make the player join team 1
    RunConsoleCommand( "team_1" )

-- Team 2 "Soldier"
team_2 = vgui.Create( "DButton", frame )
team_2:SetPos( frame:GetTall() / 2, 105 ) --Place it next to our previous one
team_2:SetSize( 50, 100 )
team_2:SetText( "[NoR] Soldier" )
team_2.DoClick = function() --Make the player join team 2
    RunConsoleCommand( "team_2" )

-- Team 3 "Sniper"
team_3 = vgui.Create( "DButton", frame )
team_3:SetPos( frame:GetTall() / 2, 105 ) --Place it next to our previous one
team_3:SetSize( 50, 100 )
team_3:SetText( "[NoR] Sniper" )
team_3.DoClick = function() 
    RunConsoleCommand( "team_3" )

-- Team 4 "Medic"
team_4 = vgui.Create( "DButton", frame )
team_4:SetPos( frame:GetTall() / 2, 105 ) 
team_4:SetSize( 50, 100 )
team_4:SetText( "[NoR] Medic" )
team_4.DoClick = function() 
    RunConsoleCommand( "team_4" )

-- Team 5 "Support"
team_5 = vgui.Create( "DButton", frame )
team_5:SetPos( frame:GetTall() / 2, 105 ) 
team_5:SetSize( 50, 100 )
team_5:SetText( "[NoR] Support" )
team_5.DoClick = function() 
    RunConsoleCommand( "team_5" )

-- Team 6 "Engineer"
team_6 = vgui.Create( "DButton", frame )
team_6:SetPos( frame:GetTall() / 2, 105 ) 
team_6:SetSize( 50, 100 )
team_6:SetText( "[Nor] Engineer" )
team_6.DoClick = function() 
    RunConsoleCommand( "team_6" )

-- Team 7 "Pilot"
team_7 = vgui.Create( "DButton", frame )
team_7:SetPos( frame:GetTall() / 2, 105 ) 
team_7:SetSize( 50, 100 )
team_7:SetText( "[NoR] Pilot" )
team_7.DoClick = function() 
    RunConsoleCommand( "team_7" )

concommand.Add( "team_menu", set_team )


function Init_Gamemode()
  Msg( "Hey" )
hook.Add( "Initialize", "initializing", Init_Gamemode );

function GM:InitPostEntity ()


function GM:RenderScreenspaceEffects ()


NextPrintTime = 0
function SecondPrint()
    if (CurTime() >= NextPrintTime) then
        Msg("This is printed every second
        NextPrintTime = CurTime() + 1
hook.Add("Think", "SecondPrint", SecondPrint)

function playerDies( victim, weapon, killer )
	Msg( "Player " .. victim:GetName() .. " has died."
hook.Add( "PlayerDeath", "playerDeathTest", playerDies

Anything wrong with it? Please let me know, and what is wrong… Thank You!

PS. You don’t want to steal this gamemode… Eventought there is nothing you can’t find out for yourself in there, if I made it this faar, I know you will to… lol

It’s obviously not finding the file. Make sure it’s in the correct folder and has the .lua extension.

Are you sure there is no other error? if this contines up and you really want some help, add me and we’ll see what we can do. A little easier to chat at least. --Kalik911

Ok, thanks