= 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 = 25 - this is how much damage your weapon will do if you shoot somebody in the centre of their chest, keep in mind that headshots will deal twice as much damage and shooting them in the arms and legs will do reduced damage. = 5 - higher recoil will jerk your view around more and make it harder to control the weapon when firing rapidly = Sound("Weapon_Deagle.Single") - what type of bang bang sound your gun makes when you fire it SWEP.AdminOnly = false - whether or not you need to hold admin rank to spawn this weapon, this used to be called SWEP.AdminSpawnable but garry changed it recently SWEP.Spawnable = true - sets whether this weapon can be spawned from the q menu or not SWEP.WorldModel = "models/weapons/w_pist_deagle.mdl" - sets what model your weapon shows as to everybody else and on the ground if you drop it SWEP.ViewModel = "models/weapons/v_pist_deagle.mdl" - sets your weapon's first person model, must be a properly rigged and animated weapon model or things may get freaky SWEP.ViewModelFlip = true - sets which side of the screen your weapon appears in first person, so that lefties can piss everybody else off by making left handed sweps set it to 1 to have retarded slenderman arms SWEP.ViewModelFOV = 70 - how far away from your body the weapon is held in first person, higher numbers bring the weapon closer. SWEP.Category = "Mad Cows Weapons" - the category your weapon appears in in the q menu SWEP.Base = "weapon_mad_base" - what code base your swep uses, leave this alone for the purposes of this tutorial. SWEP.HoldType = "pistol" - sets how the weapon is held in third person. Skipping past that we get to the real meat and bones of a SWEP, the file known as a: There is nothing wrong with any of this code so leave it alone unless you have some kind of fetish for flooding your console with errors. ^ the above code sets the weapon's icon in the q menu and weapon selection menu, you will need knowledge of how to create. SWEP.WepSelectIcon = surface.GetTextureID("weapons/weapon_mad_deagle") If (file.Exists("./materials/weapons/weapon_mad_deagle.vmt", "GAME")) then Override this in your SWEP to set the icon in the weapon selection SWEP.SlotPos = 1 - 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) SWEP.Slot = 1 - What slot the weapon occupies in the weapon selection menu (for reference slot 0 is physgun, gravgun and crowbar slot) SWEP.PrintName = ".50 DESERT EAGLE" - This is what the weapon will show up as in your Q menu An example entity name is weapon_mad_aidslauncher.Įach weapon consists of 3 lua files, named cl_a, a and a Note that the entity name is NOT the actual weapon name that will appear in the Q menu, this will be defined later. 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. gma file to access its lua code) and call it the ENTITY name of your weapon. 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.įirst things first, open the addons lua/weapons section and copy and paste an existing weapon folder (this assumes you know how to extract an addon from its. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |