how To Make Gmod Weapons

Info, these are mostly self explanatory. Create a file called 'weapon_a your folder structure should be like this: you have created an addon called chairlauncher which contains a weapon called weapon_chairgun. Double-click on "Source SDK" and then "Garry's Mod." This brings up the Hammer Map Editor. First of all i will do a raw copy paste of the weapon's code and show you what each function does and how to change them around to get the desired effect. Spawnable true - sets whether this weapon can be spawned from the q menu or not minOnly false - whether or not you need to hold admin rank to spawn this weapon, this used to be called minSpawnable but garry. Known holdtypes are: ar2 camera crossbow duel fist grenade knife melee melee2 normal passive physgun pistol revolver rpg shotgun slam smg se "weapon_mad_base" - what code base your swep uses, leave this alone for the purposes of this tutorial. Add a player spawn to seal off a room after you are finish drawing. You can play with this value here - to adjust how fast we throw. (tip: weapon : Reload ) Throw 3 chairs at a time. Each weapon consists of 3 lua files, named cl_a, a and a opening cl_a yeilds this: include a intName ".50 desert eagle", this is what the weapon will show up as in your Q menu ot 1, what slot. WepSelectIcon tTextureID weapons /weapon_mad_deagle end the above code sets the weapon's icon in the q menu and weapon selection menu, you will need knowledge of how to create.vmt materials to use this properly thats it for cl_a a will contain only. This is done like. This function call below defines - the rate of fire. Governs how far down the slot it will appear, higher numbers will place the weapon towards the bottom (its generally accepted practice give the more powerful weapons higher numbers) / Override this in your swep to set the icon in the weapon selection if (file. This means that the player doesn't have to release the mouse button and press it again - it will continually fire. Thumper - Ammunition cannot exceed 2 (mad cows base calls this "Explosive C4 Ammo Gravity - (mad cows base calls this "4.6MM Ammo Battery - (mad cows base calls this "9MM Ammo GaussEnergy CombineCannon - (mad cows base calls. You can use the. Weight 5 toSwitchTo false toSwitchFrom false ot 1 otPos 2, sWEP.
  • Double-click on the Steam icon to open. Entity names are what your weapon will appear as in the code and in the in game console, they cannot contain spaces or glitches will happen. And whether only admins can spawn. Click "OK" in the pop-up window to compile your map to be used in your.
  • You gotta save it as a lua file before start editing. Example of a swep. In this tutorial we will create a weapon that fires chairs. Open your garry s mod folder.
  • if (!IsValid( ent ) ) then return end - - Set the entity's model to the passed in model - ent:SetModel( model_file ) - - Set the position to the player's eye position plus 16 units forward. Whenever we get a physics object - we need to test to make sure its valid before using. Right-click on a spot on your map and then click on "Create Object.". GMod is a sandbox game, so it requires the Steam source engine, along with another Steam game, in order to run.
  • You can also put your name in the author field so people know who made. local phys ent:GetPhysicsObject if (!IsValid( phys ) ) then ent:Remove return end - - Now we apply the force - so the chair actually throws instead - of just falling to the ground. IntName "Chair Thrower" - This will be shown in the spawn menu, and in the weapon selection menu thor your name - These two options will be shown when you have the weapon highlighted in the weapon selection menu structions.
Open your garry's mod folder. Skipping how To Make Gmod Weapons past that we get to the real meat and bones of a swep, the file known as a: swep. The higher the weight the more likely you are to switch. Choose a different texture before adding the windows and doors. This code is just informational. local velocity self. When you call this the player will fire a chair! GMod provides you with all of the tools necessary for creating your own map. Right-click on different objects on your map and then click on "Properties." Change the color of the object by clicking on "Brightness." Change other settings in the "Properties" window until you are satisfied with your map. MShots 1 - how many bullets are fired per shot, this is generally set to 1 unless you are either making a shotgun or have no understanding of how firearms work.02 - the base accuracy.
  1. Models, the view-model and the world-model to use. Draw elements by click and dragging your mouse button. Spawn Info, defines whether players can spawn this weapon from the spawnmenu.
  2. Owner:EyeAngles ) ent:Spawn - - Now get the physics object. We are using the mad cows weapon base as an example though most weapon bases look very similar to this so it's not to hard to change bases. CurTime.5 ) - Call 'ThrowChair' on self with this model self:ThrowChair( ) end - - Called when the rightmouse button is pressed - function swep:SecondaryAttack - Note we don't call SetNextSecondaryFire here because it's not.
  3. Open the addons folder. Create a folder called chairlauncher Create a folder inside called lua Create a folder inside called weapons Create a file called weapon _a Your folder structure should be like this. I can easily model, as well as texture, but it seems like there is no documentation for how to make addons for gmod. The modding page on only explains how to make tutorial videos, and if I m correct none of them have been made. From, garry s Mod.
  4. how To Make Gmod Weapons
  5. HoldType "pistol" - sets how the weapon is held in third person. self:EmitSound( ShootSound ) - - If we're the client then this is as much as we want. Click on "File" and then "Run Map" to run your map.
  6. Use the "Entity Tool" to place entities on your map. function swep:ThrowChair( model_file ) - - Play the shoot sound we precached earlier! Owner:GetAimVector * 16) ) ent:SetAngles( self. If it isn't then we'll remove the entity.


How to make a rabbit out of paper.