|
Post by iamaman24287 on Jun 7, 2016 1:34:34 GMT -8
First of all create a folder in your addons folder with no spaces, instead use underscore (_). In that folder create the following folders: lua, materials, models, sound. Now you need to get a gun skin. You can get them from gamebanana.com/skins (Only HL2 and CSS skins work) or garrysmods.org always add credit by including the link in description. Add a folder called weapons in models. Now once you get the skins add them to your weapons (in models) folder. Create a weapons folder in all other folders. In lua\weapons make a file (Open notepad, make a note for the beginning (like this "--Type stuff here") the same click save as, direct to lua\weapons and save it as shared.lua). Now type in he following code SWEP.Gun = ("abrriviation_for_pack_undrescore_swep_name")
SWEP.Category = "Your catergory"
SWEP.Author = "Your username"
SWEP.Contact = "Your email (Optinal. Leave blank if you want)"
SWEP.Purpose = "How to use SWEP"
SWEP.Instructions = "Leave blank"
SWEP.MuzzleAttachment = "1" -- 1 for css skins, muzzle for hl2 skins SWEP.ShellEjectAttachment = "2" -- 2 for css skins, 1 for hl2 skins SWEP.PrintName = "Swep name"
SWEP.Slot = 1 SWEP.SlotPos = 30
SWEP.DrawAmmo = true
SWEP.DrawWeaponInfoBox = false
SWEP.BounceWeaponIcon = false
SWEP.DrawCrosshair = true
SWEP.Weight = 3
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = true
SWEP.HoldType = "revolver" -- way you hold gun, all hl2 weapons are holdtypes and so are fists -- Okay That's all the info.
SWEP.ViewModelFOV = 65
SWEP.ViewModelFlip = true -- true for css skins, false for hl2 skins
SWEP.ViewModel = "models/weapons/model name"
SWEP.WorldModel = "models/weapons/model name"
SWEP.Base = "base" -- optinal SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.FiresUnderwater = false
-- Time for Ammo info
SWEP.Primary.Sound = Sound("sound script here")
SWEP.Primary.RPM = 115
SWEP.Primary.ClipSize = 6 -- how much ammo you want in a clip SWEP.Primary.DefaultClip = 30
SWEP.Primary.KickUp = 1 -- max up recoil SWEP.Primary.KickDown = 0.5 -- max down recoil SWEP.Primary.KickHorizontal = 0.5 -- max horizontal recoil SWEP.Primary.Automatic = false -- false for pistols and revolvers, shotguns etc. True for SMGS, Aussault Rifles etc SWEP.Primary.Ammo = "357" -- Type of ammo
SWEP.Secondary.IronFOV = 65
SWEP.data = {}
SWEP.data.ironsights = 1
SWEP.Primary.NumShots = 1
SWEP.Primary.Damage = 31 -- Damage induced when shot SWEP.Primary.Spread = .02 -- Acuarcy 0.01 is perfect, 1 is crap SWEP.Primary.IronAccuracy = .001
SWEP.IronSightsPos = Vector(2.773, 0, 0.846)
SWEP.IronSightsAng = Vector(-0.157, 0, 0)
SWEP.SightsPos = Vector(2.773, 0, 0.846)
SWEP.SightsAng = Vector(-0.157, 0, 0)
SWEP.RunSightsPos = Vector(0, 2.95, 0)
SWEP.RunSightsAng = Vector(-13.197, 5.737, 0)
-- Volia! There your SWEP
That is how you code your SWEP when you launch GMOD, the SWEP will be in your category
iamaman24287 (Developer, Moderator, Intermediate level programmer)
|
|