Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- easylua.StartWeapon("testpacwep")
- if CLIENT then
- local VIEWMODEL = {
- ["children"] = {
- [1] = {
- ["children"] = {
- },
- ["self"] = {
- ["ParentName"] = "firstperon",
- ["ClassName"] = "model",
- ["Size"] = 0.125,
- ["UniqueID"] = "3451410124",
- ["Bone"] = "v weapon lefteft thumb 02",
- ["Name"] = "barrel firstperson",
- ["ParentUID"] = "3005904956",
- },
- },
- },
- ["self"] = {
- ["EditorExpand"] = true,
- ["UniqueID"] = "3005904956",
- ["OwnerName"] = "viewmodel",
- ["Name"] = "firstperon",
- ["ClassName"] = "group",
- },
- }
- local WORLDMODEL = {
- ["children"] = {
- [1] = {
- ["children"] = {
- },
- ["self"] = {
- ["ParentName"] = "my outfit",
- ["ClassName"] = "model",
- ["Position"] = Vector(10, -0.60000002384186, -4),
- ["UniqueID"] = "508789991",
- ["Size"] = 0.35,
- ["Bone"] = "right hand",
- ["Name"] = "barrel thirdperson",
- ["ParentUID"] = "2950810582",
- },
- },
- },
- ["self"] = {
- ["EditorExpand"] = true,
- ["UniqueID"] = "2950810582",
- ["ClassName"] = "group",
- ["Name"] = "thirdperson",
- ["Description"] = "add parts to me!",
- },
- }
- pac.SetupSWEP(SWEP)
- net.Receive(SWEP.ClassName, function()
- local ent = net.ReadEntity()
- local event = net.ReadString()
- if ent:IsValid() and ent[event] then
- ent[event](ent)
- end
- end)
- function SWEP:AttachOutfit()
- self:AttachPACPart(VIEWMODEL)
- self:AttachPACPart(WORLDMODEL)
- end
- function SWEP:DetachOutfit()
- self:RemovePACPart(VIEWMODEL)
- self:RemovePACPart(WORLDMODEL)
- end
- SWEP.OnRemove = SWEP.DetachOutfit
- function SWEP:PrimaryAttack(...)
- local barrel = self:FindPACPart(WORLDMODEL, "barrel thirdperson")
- self.i = (self.i or 0) + 2
- barrel:SetPositionOffset(Vector(self.i,0,0))
- return self.BaseClass.PrimaryAttack(self, ...)
- end
- end
- if SERVER then
- util.AddNetworkString(SWEP.ClassName)
- function SWEP:Deploy(...)
- net.Start(self.ClassName)
- net.WriteEntity(self)
- net.WriteString("AttachOutfit")
- net.Broadcast()
- return self.BaseClass.Deploy(self, ...)
- end
- function SWEP:Holster(...)
- net.Start(self.ClassName)
- net.WriteEntity(self)
- net.WriteString("DetachOutfit")
- net.Broadcast()
- return self.BaseClass.Holster(self, ...)
- end
- SWEP.OnDrop = SWEP.Holster
- SWEP.OnRemove = SWEP.Holster
- end
- SWEP.PrintName = "P228" -- 'Nice' Weapon name (Shown on HUD)
- SWEP.Slot = 2 -- Slot in the weapon selection menu
- SWEP.SlotPos = 3 -- Position in the slot
- SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter -- Should draw the default crosshair
- SWEP.DrawWeaponInfoBox = true -- Should draw the weapon info box
- SWEP.BounceWeaponIcon = true -- Should the weapon icon bounce?
- --[[cl_init.lua]]
- -- Variables that are used on both client and server
- SWEP.Category = "guns"
- SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models
- SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models
- SWEP.DrawCrosshair = false
- SWEP.ViewModelFOV = 65
- SWEP.ViewModelFlip = true
- SWEP.ViewModel = "models/weapons/v_pist_p228.mdl"
- SWEP.WorldModel = "models/weapons/w_pist_p228.mdl"
- SWEP.Base = "gdcw_base_pistol"
- SWEP.Spawnable = true
- SWEP.AdminSpawnable = true
- SWEP.Primary.Sound = Sound("Weapon_P228.Single")
- SWEP.Primary.Round = ("5_7mm")
- SWEP.Primary.RPM = 900 -- This is in Rounds Per Minute
- SWEP.Primary.ClipSize = 13 -- Size of a clip
- SWEP.Primary.DefaultClip = 14
- SWEP.Primary.KickUp = 0.4 -- Maximum up recoil (rise)
- SWEP.Primary.KickDown = 0.3 -- Maximum down recoil (skeet)
- SWEP.Primary.KickHorizontal = 0.3 -- Maximum up recoil (stock)
- SWEP.Primary.Automatic = false -- Automatic/Semi Auto
- SWEP.Primary.Ammo = "pistol"
- SWEP.Secondary.ClipSize = 1 -- Size of a clip
- SWEP.Secondary.DefaultClip = 1 -- Default number of bullets in a clip
- SWEP.Secondary.Automatic = false -- Automatic/Semi Auto
- SWEP.Secondary.Ammo = ""
- SWEP.Secondary.IronFOV = 50 -- How much you 'zoom' in. Less is more!
- SWEP.data = {} -- The starting firemode
- SWEP.data.ironsights = 1
- SWEP.IronSightsPos = Vector (4.7715, 0, 2.9797)
- SWEP.IronSightsAng = Vector (-0.6263, 0.0401, 0)
- SWEP.SightsPos = Vector (4.7715, 0, 2.9797)
- SWEP.SightsAng = Vector (-0.6263, 0.0401, 0)
- SWEP.RunSightsPos = Vector (1.6926, 0, 3.6188)
- SWEP.RunSightsAng = Vector (-21.0418, -0.1143, 0)
- easylua.EndWeapon(true)
Advertisement
Add Comment
Please, Sign In to add comment