Garry's Mod

Garry's Mod

Not enough ratings
[Modless] Server-wide loadout, change walkspeed, etc.
By DoujinshiGod
By going to your Gmod folder, you can modlessly change starting weapons, walkspeed, jumppower, flashlight availibility, health & armor, player/player colisions, and held weapons being dropped on death.
   
Award
Favorite
Favorited
Unfavorite
Navigation
You will need to know where your Gmod common folder is. Many other guides reference how to get there. For me, I go to C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod.

Once you reach this magical place, go to your gamemodes folder. This method of modifying your files is gamemode specific, so select the gamemode you want to modify. I will be modifying my Sandbox files, because each gamemode overrides the base settings.



After you do that, go to your gamemode/player_class folder. You will now need to open the player_class lua file with notepad. This is where you can start modifying files.
Variable Modification
Once you open the file, it should look something like this:


These are the variables I know how to change:

PLAYER.WalkSpeed = 400 -- How fast to move when not running
PLAYER.RunSpeed = 600 -- How fast to move when running
PLAYER.CrouchedWalkSpeed = 0.3 -- Multiply move speed by this when crouching
PLAYER.DuckSpeed = 0.3 -- How fast to go from not ducking, to ducking
PLAYER.UnDuckSpeed = 0.3 -- How fast to go from ducking, to not ducking
PLAYER.JumpPower = 200 -- How powerful our jump should be
PLAYER.CanUseFlashlight = true -- Can we use the flashlight
PLAYER.MaxHealth = 100 -- Max health we can have
PLAYER.StartHealth = 100 -- How much health we start with
PLAYER.StartArmor = 0 -- How much armour we start with
PLAYER.DropWeaponOnDie = false -- Do we drop our weapon when we die
PLAYER.TeammateNoCollide = true -- Do we collide with teammates or run straight through them
PLAYER.AvoidPlayers = true -- Automatically swerves around other players
PLAYER.UseVMHands = true -- Uses viewmodel hands

To add a variable that isn't there, simply paste one of the above directly underneath the last PLAYER variabe there. For me, I will be placing WalkSpeed, RunSpeed, CrouchedWalkSpeed, and DropWeaponOnDie under PLAYER.UnDuckSpeed.

As you can see above, I changed some of the variables to my liking. You should probably test out your new settings in singleplayer before you create a listen server.
Loadout Modification
If you scroll down a little bit in the player_class document, you should see something like this:

The upper area of the screenshot shows the ammunition and guns that are given to you when you enable weapons (all hl2 weapons in this case), and the bottom area shows the ammunition and guns that are given to you reguardless (the toolgun, physgun, and camera in this case).

To add a weapon and its ammo to this list, you must know the weapon and ammo "script" name. To find that, go into Gmod and right click the weapon you want. Select "copy to clipboard" and paste its name somewhere you can get it. I will be doing this with FA:S weapons.

The IMI Galil's "script" name is fas2_galil.
The IMI Galil's ammunition "script" name is fas2_ammo_556x45

Next, just copy over the names to repace the ones there. You can remove lines if you want, but make sure to copy them exactly if you want to add lines.
End
Hopefully this helped you in setting up a server. This works with both dedicated and listen servers, you just need to find their respective file paths.

If you need individiual loadouts for each person, I recommend this addon:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=199226357

Feel free to post a comment if you have any questions.
28 Comments
Arianit 19 Feb, 2019 @ 11:54am 
An addition to this - if you can't find a player_class - most likely that your gamemode is using Sandbox as a base. In this case - go and use the player_class file in Sandbox instead.
Half Way Lambda 28 Jan, 2017 @ 10:13am 
@Jimbob
Indeed it is a pain in the balls. So weird that eveything works fine except the most important thing....And yes, everything is in place, but i'll still see if i can find it out.. ;/
DoujinshiGod  [author] 28 Jan, 2017 @ 10:11am 
@Half Way Lambda
@1ite1

I've never done that stuff before. You're better off looking for guides on how to make entirely new gamemodes, or dissecting a gamemode off of the workshop. Use the Gmad Extractor for that.

As for what I know, Lambda, the ability to open the spawnmenu comes from a couple different places. If all the folders and files are there and it still doesn't work, you've gotta rename something.

It sounds like a pain in the balls.
Half Way Lambda 28 Jan, 2017 @ 2:55am 
I tried making a copy of the sandbox gamemode and changing stuff in that copy, but when i create a server with the setting 2 players, the spawnmenu doesn't open at all. It could be some conflictions but how can i fix this?
Jimboboiii 9 May, 2016 @ 2:53pm 
If I copy and paste my Sandbox gamemode, rename it, and edit it, will I be able to select it and will it work? Because I want to make a little gamemode me and my friends can play
DoujinshiGod  [author] 9 May, 2016 @ 2:34pm 
@Dr Krautz

You lost the file somewhere along the way or just aren't doing it right. Not that you didn't already know that.

I would suggest making sure you are editing the right gamemode, loading the right gamemode, and properly editting the file as per above. Rinse and repeat until you find your screwup.

Worst case scenario is that you can't revert it- in that case, verify your game cache by right clicking Garry's Mod in your Steam library, clicking "properties", and searching under "local files". That will reset all the files in your game's directory to factory settings and you can get back to happily editting away.
🍗KentuckyFriedMoa🍗 9 May, 2016 @ 12:55am 
when I changed the loadout a second time it never changed from the previous one and I've been restarting, closing gmod, saving it over and over again and re-writing the loadouts. I don't want to uninstall it unless it's the solution.
Jimboboiii 23 May, 2015 @ 7:31pm 
@NightShadow, Just copy and paste the location that's at the start of the guide, that's what I did.
DoujinshiGod  [author] 23 May, 2015 @ 7:00pm 
Are you sure you looked in the right garrysmod folder?

If you did, I can't help you.
Snowfall 23 May, 2015 @ 3:54pm 
I dont have any gamemodes file :/