Want to ensure players have all the necessary content when they join your server? You can force client downloads of Workshop addons using a simple script. Follow the steps below to configure it through your Imperium Hosting control panel.
Step-by-Step Instructions
-
Log Into Your Control Panel
Head over to the Imperium Hosting Control Panel and log in with your credentials. -
Access Your Garry’s Mod Server
Click on your Garry’s Mod game service to open the server management view. -
Open the File Manager
From the sidebar or module list, click “File Manager.” -
Navigate to the Autorun Folder
-
Go to the directory:
garrysmod/lua/autorun -
If it doesn’t already exist, create a new folder here named:
server
-
-
Create the
workshop.luaFile-
Inside the
garrysmod/lua/autorun/server/folder, create a new file named:workshop.lua
-
-
Edit the File in the Text Editor
-
Click the pencil icon next to
workshop.luato open it in the editor -
For each Workshop addon you want players to download, add a line like:
resource.AddWorkshop("workshopidhere")Replace
workshopidherewith the actual Workshop ID (found at the end of each addon’s URL).
-
Example:
Let’s say you’re using the following M9K weapon packs:
-
https://steamcommunity.com/sharedfiles/filedetails/?id=128089118
-
https://steamcommunity.com/sharedfiles/filedetails/?id=128093075
-
https://steamcommunity.com/sharedfiles/filedetails/?id=128091208
Your workshop.lua file would look like this:
resource.AddWorkshop("128089118")
resource.AddWorkshop("128093075")
resource.AddWorkshop("128091208")
Optional: Use a Workshop Generator Tool
For larger addon lists, you can use this tool to generate your code automatically:
GMod Universal Workshop Tool
Final Step: Restart Your Server
After saving the file, return to your control panel and restart your server. Clients will now be prompted to download the required addons when they connect.
You're All Set!
Players will automatically download the content you've specified, ensuring a seamless in-game experience.
Need help finding Workshop IDs or troubleshooting client errors? Submit a support ticket, we’re happy to help!