Something is wrong....I'm scared

Every time I try to test my gamemode it reverts it back to sandbox. I don’t understand. I see no errors in my work. These are the only files I have in my gamemode for now until I can solve this problem. I have been at this all day now and it flusters me.

AddCSLuaFile( “cl_init.lua” )
AddCSLuaFile( “shared.lua” )
AddCSLuaFile( “loadout.lua” )

include( ‘shared.lua’ )

include( ‘shared.lua’ )


GM.Name = “New Worlds”
GM.Author = “Cartguy”
GM.Email = “
GM.Website = “N/A”

team.SetUp( 1, “Freelancer”, Color(0, 255, 0, 255)) --Green Color

team.SetUp( 2, “The Empire”, Color(0, 0, 200, 255)) --Dark Blue Color

team.SetUp( 3, “Recilian Forces”, Color(0, 0, 255, 255)) --Blue Color

team.SetUp( 4, “Red Star Alliance”, Color(255, 0, 0, 255)) --Red Color

function GM:PlayerInitialSpawn( ply )

ply:SetTeam( 1 )


function GM:PlayerLoadout( ply )

if ply:Team() == 1 then --Freelancer

ply:Give( "weapon_physcannon" )

elseif ply:Team() == 2 then --The Empire

ply:Give( "weapon_physcannon" )

elseif ply:Team() == 3 then --Recilian Forces

ply:Give( "weapon_physcannon" )

elseif ply:Team() == 4 then --Red Star Alliance

ply:Give( "weapon_physcannon" )


function GM:CanPlayerSuicide( ply )
return false

My console code I get when I try testing it

Mounting hl2.. Not Mounting hl2 (no access)
Not Mounting hl2 (no access)
Mounting ep2.. Not Mounting ep2 (no access)
No permission
Mounting tf.. Not Mounting tf (no access)
No permission
Mounting cstrike.. OK
Mounting dod.. OK
Mounting episodic.. Not Mounting episodic (no access)
No permission
Mounting hl2mp.. OK
Mounting portal.. Not Mounting portal (no access)
No permission
Mounting lostcoast.. Disabled
Mounting hl1.. Not Mounting hl1 (no access)
No permission
Mounting hl1mp.. Not Mounting hl1mp (no access)
No permission
Mounting zeno_clash.. Not Mounting zeno_clash (no access)
No permission
Parent cvar in server.dll not allowed (sk_apc_missile_damage)
Garry's Mod server.dll Build #082 [Jun  2 2010 11:02:58]
maxplayers set to 128
Steam config directory: c:\program files\steam\steamapps\cartguy\garrysmod\platform\config
Parent cvar in server.dll not allowed (sv_scriptenforcer_initialkick)
Didn't find particle function fade_and_kill
Didn't find particle function spin
Didn't find particle function random_radius
Didn't find particle function random_rotation
Didn't find particle function initialize_within_sphere
Garry's Mod client.dll Build #082 [Jun  2 2010 11:02:55]
maxplayers set to 1
Unknown command "sv_backspeed"
GetAllManifestFiles:  Unable to load maplist.txt
maxplayers set to 1
Unknown command "sv_rollangle"
Unknown command "sv_unlag_fixstuck"
Lua initialized (Lua 5.1)
Reverting sv_defaultgamemode to sandbox - gamemode is not valid.
Registering gamemode 'sandbox' derived from 'base'
ScriptEnforce is disabled
Executing listen server config file
exec: couldn't exec listenserver.cfg
InitFastCopy: only 51% fast props. Bug?
Lua initialized (Lua 5.1)
Registering gamemode 'sandbox' derived from 'base'
Sending 267 'User Info' ConVars to server (cl_spewuserinfoconvars to see)
Redownloading all lightmaps

I don’t understand what is wrong, I barely even doing anything with the code I have done. I just hope someone will come along and help me fix this.

did you put an info.txt in your gamemode folder?

Yes, This is what I have for my info.txt

	"name"		"New Worlds"
	"version"	"1.0"

	"author_name"	"Cartguy"
	"author_email"	""
	"author_url"	""
	"icon"		""
	"info"		""
	"hide"		""

thats pretty weird, the console log says it loads sandbox, but it wont load your gamemode

In which folder did you put those Lua files? They should be in gamemodes/<gamemode name>/gamemode/.

What did you enter as gamemode name for your server? It should be the gamemode’s folder name.

My folder which holds the info.txt, and the gamemode folder and the enitites folder is named “New Worlds” and that is the name in my info.txt and in my shared.lua.

I put the files in steam/steamapps/cartguy/garrysmod/garrysmod/gamemodes/New Worlds

I know thats the right spot to place gamemodes to test. And when I go into garrysmod main menu, click on singleplayer switch the gamemode from sandbox to New Worlds and click the map gm_construct.

And that is what it does, i don’t know whats wrong with it its so weird and confusing.

Reverting sv_defaultgamemode to sandbox - gamemode is not valid.

Obviously not a problem with the Lua.

I was once told that you couldn’t run custom gamemodes in singleplayer, but rather only in multiplayer.

I may have been told wrongly, though, but just for the sake of experimentation, try to run a multiplayer game with it, with a password or something.

no, you can run custom gamemodes in singleplayer, I haven’t always had this problem. Just ever since I picked up Lua again it keeps doing this. First time I started lua, I had no problems with running my custom gamemodes in singleplayer. And just to make sure I downloaded the gamemode “Underdone” and ran that in singleplayer and it worked fine. Maybe its something wrong with my garrysmod game files. I still don’t know :confused:

You cant have spaces in gamemode folders