- #Best weapon addons for gmod mod
- #Best weapon addons for gmod code
- #Best weapon addons for gmod download
You can //set it to -1 to disable the ammo system, meaning primary ammo will //not be displayed and will not be affected. This determins how big each clip/magazine for the gun is.
#Best weapon addons for gmod code
The following code sets up the SWeps primary/secondary fire and ammo. SWEP.WorldModel = "models/weapons/w_rocket_launcher.mdl" - This is the model shown to all other clients and in third-person. SWEP.ViewModel = "models/weapons/v_RPG.mdl" - This is the model used for clients to see in first person. SWEP.AdminSpawnable = true - Whether Admins/Super Admins can see it SWEP.Spawnable = true - Whether regular players can see it
#Best weapon addons for gmod mod
It tells Garry's Mod what player groups can see the SWep in the Spawn (Q) Menu. The next piece of information is important.
![best weapon addons for gmod best weapon addons for gmod](https://i.ytimg.com/vi/tbhztGjXuS4/maxresdefault.jpg)
SWEP.Instructions = "How to operate your SWep" //The category that you SWep will be shown in, in the Spawn (Q) Menu //(This can be anything, GMod will create the categories for you) Your SWep will work without most of this information, but it's ideal to include details. Note: We will be using the single file ( a) layout for this tutorial.Īt the top of the a file, you can enter all of the information that will define a SWep's name, category, and certain behaviours, amongst other things. Language.Add ( "Undone_Thrown_SWEP_Entity", "Undone Thrown SWEP Entity" ) end
![best weapon addons for gmod best weapon addons for gmod](https://cdn.cloudflare.steamstatic.com/steam/apps/4000/ss_65ec9828538eac8db20efc8149990060911fefc4.1920x1080.jpg)
How it works: //When you create an undo, you specify the ID: // undo.Create("Some_Identity") //By creating an associated language, we can make the undo notification look better: // language.Add("Undone_Some_Identity", "Some message.") SWEP.DrawCrosshair = false //Ensures a clean looking notification when a chair is undone. SWEP.DrawAmmo = false //Sets the drawing of the crosshair when this weapon is deployed SWEP.SlotPos = 1 //Sets drawing the ammuntion levels for this weapon SWEP.PrintName = "Chair throwing gun" //Sets the position of the weapon in the switching menu //(appears when you use the scroll wheel or keys 1-6 by default) SWEP.AutoSwitchFrom = false elseif CLIENT then // This is where the cl_a stuff goes //The name of the SWep, as appears in the weapons tab in the spawn menu(Q Menu) SWEP.Weight = 5 //Allow automatic switching to/from this weapon when weapons are picked up
#Best weapon addons for gmod download
This makes sure clients download the fileĪddCSLuaFile ( "a" ) //How heavy the SWep is If SERVER then // This is where the a stuff goes.
![best weapon addons for gmod best weapon addons for gmod](https://is2-ssl.mzstatic.com/image/thumb/Purple71/v4/55/69/9c/55699c66-fb46-4bb1-bb7e-ba92d9cf2137/source/512x512bb.jpg)
You can also use the else/elseif statement instead of two if statements, to tidy up the code. Now, create a new directory with a simple name (without spaces) for your SWep. The default location of the steam folder is C:\Program Files\Steam, or C:\Program Files (x86)\Steam for 64-bit operating systems. Go to the directory (folder): /steamapps//garrysmod/garrysmod/lua.
![best weapon addons for gmod best weapon addons for gmod](https://www.gamersdecide.com/sites/default/files/authors/u156303/ww2.jpg)
In this tutorial, we will be making a SWep with the RPG Launcher model to fire chairs.įirst of all, it is suggested you download a good code editor such as Notepad++, with a GMod Lua syntax highlighter like this one. Popular choices for SWeps include launching objects, such as watermelons or chairs, and 'better' versions of existing weapons, like a crossbow that can shoot several bolts per second. Better known as a SWep (or SWEP in some cases) a scripted weapon is a weapon that has an underlying script controlling its operation.