Gamemode not loading

I’ve created a gamemode, all functions in there to actually work, but when i select it from the drop down menu of the Create Multiplayer tab, and click create, i join, but it creates a sandbox server instead, WTH?

You need an info.txt for your gamemode, goes inside the (gamemode name) folder in gmod/gamemodes.

I have got that.




Theres probbably an error… or something, check console and test gamemode_reload

Here is the error

Couldn't include file 'Garry Company/gamemode/init.lua' (File not found)
********** COULDN'T LOAD GAMEMODE!! **********

There was a problem opening the gamemode file 'Garry Company/gamemode/init.lua'

Take the space out of the folder name

You can’t put spaces in the gamemode folder.

Thats what I just said…

Thank you King Flawless it worked.

But now i’m getting this:

ERROR: GAMEMODE:'PlayerInitialSpawn' Failed: GarryCompany/gamemode/init.lua:23: attempt to call a string value

If you need the line of code for that, please ask :3

paste code

I’ll give you the whole function.

[lua]function GM:PlayerInitialSpawn( ply )
self.BaseClass:PlayerInitialSpawn ( ply )
file.Write( “Garry Company/ServerPlayers.txt”, "/nPlayerName: " …ply:Nick() "/nPlayer SteamID: " …ply:SteamID() "/nPlayer Kills: " …ply:Frags() “/nPlayer Deaths: " …ply:Deaths() )
if ply:IsSuperAdmin() then
ply:SetModel( “models/player/fallout_3/tesla_power_armor.mdl” )
ply:PrintMessage( HUD_PRINTTALK, “GCompany: Welcome to the server I recognise you as a Super Admin /nName:” …ply:Nick() “/nRank: Super Admin /nSteamID:” …ply:UniqueID() )
ply:SetName( “(Super)” …ply:Nick() )
ply:IsAdmin() then
ply:SetModel( “models/player/fallout_3/t51b.mdl” )
ply:PrintMessage( HUD_PRINTTALK, “GCompany: Welcome to the server I recognise you as an Admin /nName:” …ply:Nick() “/nRank: Admin /nSteamID:” …ply:UniqueID() )
ply:SetName( “(Admin)” …ply:Nick() )
ply:SetModel( “models/player/charple01.mdl” )
ply:PrintMessage( HUD_PRINTTALK, “GCompany: Welcome,” …ply:Nick() " to the GCompany Server, have fun, and obey the rules” )
ply:SetName( “(Guest)” …ply:Nick() )

line 23 would be?

[lua]file.Write( “Garry Company/ServerPlayers.txt”, "/nPlayerName: " …ply:Nick() "/nPlayer SteamID: " …ply:SteamID() "/nPlayer Kills: " …ply:Frags() "/nPlayer Deaths: " …ply:Deaths() ) [/lua]

You are forgetting …'s all over your code, make sure you put it like this

[lua]local examplestring = “string” … ply:SteamID() … " more string" … ply:Name() … " The end."[/lua]

EDIT: Except if you do it at the end ofcourse:
[lua]local lastexample = "My SteamID: " … ply:SteamID()[/lua]

Thankyou, i thought you just put the “…” before the ply:blahblahblah stuff.
Thanks for telling me

You place it between everything you want to contatenate into a single string.

Yeah well I didn’t know, but thanks for telling me :smiley: It’s working now.