How do I use the workshop with my server?

Introduction

The Steam Workshop is a very useful tool for server owners, particularly with adding custom content such as addons and models. Instead of uploading all of an addon's custom content to your file server, and then setting up a FastDL script so that your player's download the content to their client, you can instead click a button to add an addon to your Workshop collection, and code one line to add all of the content to your player's download queue.

Instructions
  1. The first thing we need to do is create a collection of the addons you wish to use. You can do this by clicking this link and then click the "Create Collection" button on the right. If you don't see the "Create Collection" button on the right, make sure you're signed in to your Steam account. You can click the Login button in the upper-right hand section of the screen to log in.
  2. The next thing you'll need to do is register for a Steam Web API key. Think of this key as a password, you don't want to share it with others! You can register for your API key at the following page: http://steamcommunity.com/dev/apikey
  3. Now we need to add your collection and API key to your server. You'll now want to log into ForcePanel and navigate to your server's page. Once you're there, you'll want to scroll down to the section "Server Configuration" and input your collection's ID under Workshop Collection ID and your Steam Web API key under Authkey.
    1. NOTE: The Workshop Collection ID is found in the URL of the collection. For example, the M9K Weapons Full Pack collection ID is 300653696.
  4. The Workshop will now be working with your server! However, there is another step if you want your players to download the content from each addon. If you don't follow this step and your addon uses custom models (such as TDMcars, a custom model, etc.) then your players will see errors once they connect. To remedy this, you'll need to create or edit a Lua script so that the Garry's Mod client knows that you wish for your players to download the files. The Lua script can be named whatever you'd like, and it will be placed inside of your server's /garrysmod/lua/autorun/server directory. The inside of your Lua script will need to look like the following:
resource.AddWorkshop("addon ID")

        So, to further elaborate, let's say you added the following addon to your Workshop collection: http://steamcommunity.com/sharedfiles/filedetails/?id=104606562
        Your Lua script would simply contain the following line of code:

resource.AddWorkshop("104606562")

        We obtain the ID (104606562) from the URL as you may have guessed. You can see ?id=104606562, you'll simple copy that number to the right of ?id=. Unfortunately, at the time of writing, there isn't a function to force every addon in your collection ID to download, so you'll need to add each respective addon ID for this to work. 

NOTE: You must use the ADDON ID in resource.AddWorkshop(). NOT the COLLECTION ID. FastDL will not work if you use resource.AddWorkshop with your COLLECTION ID.

Confused?

Check out the below link for instructions directly from the Garry's Mod wiki page:
http://wiki.garrysmod.com/page/Workshop_for_Dedicated_Servers


Check out the below link for instructions with using the resource.AddWorkshop function:
http://wiki.garrysmod.com/page/resource/AddWorkshop
  • 74 Users Found This Useful
Was this answer helpful?

Related Articles

How do I change my server's name?

To change your server's name, follow the below steps. Log into the control panel. Click the...

How do I make my server private?

You can password-protect your Garry's Mod server in order to keep random players from joining. To...

How do I change my server's settings? (prop limit, vehicle limit, etc.)

Changing the server's settings Log into the Control Panel. Click the "Manage" button. Click...

How do I upgrade or downgrade my server?

You are welcome to upgrade or downgrade your service at any time. When you make a change to your...

How do I change my server's gamemode?

In order to change your server's gamemode, please follow the below steps. Table of Contents:...