Skip to content

Tool Modding

Rubat edited this page Feb 23, 2021 · 3 revisions

This page teaches how to add new stuff to the Sandbox tool. All of the code in this section must be called shared - both on client and server.

Adding models for the tool

list.Set( "LightsaberModels", "<pathToModel>", {} )
  • <pathToModel> is your path to the model file.
    • Must start with models/ and end with .mdl, for example models/weapons/stuff.mdl.

Adding a set of ignition sounds for the tool

list.Set( "rb655_LightsaberIgniteSounds", "#myCustomUniqueInternalName", {
	rb655_lightsaber_onsound = "<pathToOnSound>",
	rb655_lightsaber_offsound = "<pathToOffSound>"
} )
  • <pathToOnSound> is your path to the sound file for the Ignition sound.
    • Must NOT start with sound/, for example lightsabers/myOnSound1.wav.
    • File format MUST be compatible with Garry's Mod, so either .wav or .mp3 will do. Recommended format is .wav.
  • <pathToOffSound> is the same as above, but for the Extinguish sound.
  • #myCustomUniqueInternalName is your internal name for the sound, that will appear in the tool UI.
    • You should translate it to a real/proper name with language.Add like so:
language.Add( "#myCustomUniqueInternalName", "My Custom Sound" )

Adding swing sounds

list.Set( "rb655_LightsaberSwingSounds", "#myCustomUniqueInternalName", {
	rb655_lightsaber_swingsound = "<pathToSwingSound>"
} )
  • <pathToSwingSound> is your path to the looping sound file for swings. Rules from above apply.
    • Learn how to make looping .wav files here.

Adding hum sounds

list.Set( "rb655_LightsaberHumSounds", "#myCustomUniqueInternalName", {
	rb655_lightsaber_humsound = "<pathToHumSound>"
} )
  • <pathToHumSound> is your path to the looping sound file for idle hum. Rules from above apply.