Garry's Mod

Garry's Mod

Dr > Breens Mystery Box Machine
 This topic has been pinned, so it's probably important
Bad Dreems  [developer] 15 Mar, 2021 @ 2:38pm
HOW TO ADD YOUR OWN WEAPONS TO THE MACHINE
Before undergoing this, I would advise for you to use/download a text editing program such as SUBLIME or NOTEPAD++ as I can not be sure that you will not run into issues if you use the default Notepad editor

Get the game running

Launch Gmod and start a new game.
When you get into the game, spawn the Mystery Box Machine.

(You have to have spawned the machine at least ONCE or you will not be able to proceed)

(I also recommend having the game up and running while doing this because it will make the process of adding weapons easier in my honest opinion.






Where to go

Navigate to your GarrysMod/garrysmod/data folder.

(You can get here by going to your [Drive Where you have Steam or Extra Drive used by steam where Gmod is Installed]\ Steam\steamapps\common\GarrysMod\garrysmod\data)

(You can also get here by going to your Garry's Mod Properties / Local Files / and hitting the Browse Button near the top)

Inside of your data folder

Look for the folder named
"mysteryboxmachine"

This is the folder that contains the files which will hold the names of all the weapons this machine can spawn, it will not exist until you have spawned the machine for the first time.
Do not worry about spam or overwriting, as the folder and files are only written if they do not currently exist.

Inside of "mysteryboxmachine"

You should see 10 text documents

  • artable.txt (This is Big Machine guns in game)
  • bigpistoltable.txt
  • launchertable.txt
  • meleetable.txt
  • pistoltable.txt
  • shotguntable.txt
  • smgtable.txt
  • snipertable.txt
  • specialtable.txt
  • throwabletable.txt

Open which file / category you wish to add to with your text editor of choice (I use sublime)

For this lesson, let's open artable.txt

Inside the text files

You're going to find one weapon inside of here.
weapon_ar2

It looks pretty lonely, so here is how you can give it some friends!

You are going to want to get the CLASSNAME of whichever weapon you want to add.
For example weapon_ar2 is the class name for the Pulse Rifle.
Take note that there is a _ instead of a SPACE.


In my opinion, the easiest way for you to get the classname of the weapons you want to add is to go in game and Right Click in the Weapons tab of your Spawn Menu

Right click the weapon you want to add and in the dropdown box that shows up, select
[COPY TO CLIPBOARD]

What this does is copies the Classname of the weapon.

What you want to do now is to mosey on over to that text file-
( The one with the lonely ar2 )
-and PASTE on the next line beneath the last weapon in the file.

If you did this in the artable file it would look like this



weapon_ar2
(Classname of whatever weapon you put)


DO NOT create ANY blank lines or add ANY SPACES before or after your weapons, doing this will cause the machine to not work.

When you are all done or wish to test it, SAVE the text file and give the machine a try in the game, you do not need to Respawn it.

You do not have to leave the HL2 weapons in the files if you do not wish for them to show up anymore. As long as you do not leave the text files BLANK.
(If you leave them blank, the machine is not going to work)

That's about it!

Add as many weapons from as many different addons or bases as you wish, they should all be able to be spawned by chance!

Good luck and happy gambling!





I don't understand what to do or my addon isn't working anymore, HELP!

Not to worry mate, leave a comment down below explaining your issue and I'll do my best to get you sorted whenever I can.

I explained this the best I can, so that means I did a ♥♥♥♥♥♥ job.
Last edited by Bad Dreems; 15 Mar, 2021 @ 3:16pm
< >
Showing 1-4 of 4 comments
I believe I've seen scripts before where the list auto-fills with all weapons currently installed, although I don't know how the thing works itself I think the creator of the OG COD zombies mystery box figured out how to do it
Last edited by Zuletzt bearbeitet von REMO; 7 Apr, 2021 @ 12:48pm
perhaps it can be of some educational use?
Bad Dreems  [developer] 7 Apr, 2021 @ 1:42pm 
Originally posted by Zuletzt bearbeitet von REMO:
perhaps it can be of some educational use?

Why look at that, I hadn't an idea this addon existed.

I do believe I could learn a thing or two from it though, thank you!

I made this and my other machine addon as learning tools on gmod addon creation, so anything new is certainly appreciated!
< >
Showing 1-4 of 4 comments
Per page: 1530 50