Make weapons automatically spawn with player?

So, I have a custom weapon plugin that adds CS:S weapons into the game. Currently, my p228 automatically spawns with the player. I want to take this out and make dual elites spawn with the player instead. Any ideas on how? Here’s the shared.lua files of both:

p228:
[lua]
if SERVER then
AddCSLuaFile( “shared.lua” )
end

SWEP.HoldType = “pistol”

if CLIENT then
SWEP.PrintName = “P228”
SWEP.Slot = 1

SWEP.Icon = “VGUI/ttt/icon_pistol”
end

SWEP.Kind = WEAPON_PISTOL
SWEP.WeaponID = AMMO_PISTOL

SWEP.Base = “weapon_tttbase”
SWEP.Primary.Recoil = 1.5
SWEP.Primary.Damage = 25
SWEP.Primary.Delay = 0.25
SWEP.Primary.Cone = 0.02
SWEP.Primary.ClipSize = 20
SWEP.Primary.Automatic = true
SWEP.Primary.DefaultClip = 20
SWEP.Primary.ClipMax = 60
SWEP.Primary.Ammo = “Pistol”
SWEP.AutoSpawnable = true
SWEP.AmmoEnt = “item_ammo_pistol_ttt”

SWEP.InLoadoutFor = {ROLE_INNOCENT, ROLE_TRAITOR, ROLE_DETECTIVE}

SWEP.ViewModel = “models/weapons/v_pist_p228.mdl”
SWEP.WorldModel = “models/weapons/w_pist_p228.mdl”

SWEP.Primary.Sound = Sound( “Weapon_P228.Single” )
SWEP.IronSightsPos = Vector(4.75, -3, 4.898)
SWEP.IronSightsAng = Vector(-0.239, 0.05, 0)
SWEP.SightsPos = Vector(4.75, 0, 2.898)
SWEP.SightsAng = Vector(-0.239, 0.05, 0)
SWEP.RunSightsPos = Vector(-2.132, -1.149, 2.131)
SWEP.RunSightsAng = Vector(-15.492, -13.771, 0)[/lua]

Dual Elites:
[lua]
if SERVER then
AddCSLuaFile( “shared.lua” )
end

SWEP.HoldType = “pistol”

if CLIENT then
SWEP.PrintName = “Double Elites”
SWEP.Slot = 1

SWEP.Icon = “VGUI/ttt/icon_pistol”
end

SWEP.Kind = WEAPON_PISTOL
SWEP.WeaponID = AMMO_PISTOL

SWEP.Base = “weapon_tttbase”
SWEP.Primary.Recoil = 1.5
SWEP.Primary.Damage = 25
SWEP.Primary.Delay = 0.18
SWEP.Primary.Cone = 0.02
SWEP.Primary.ClipSize = 20
SWEP.Primary.Automatic = true
SWEP.Primary.DefaultClip = 20
SWEP.Primary.ClipMax = 60
SWEP.Primary.Ammo = “Pistol”
SWEP.AutoSpawnable = true
SWEP.AmmoEnt = “item_ammo_pistol_ttt”

SWEP.ViewModel = “models/weapons/v_pist_elite.mdl”
SWEP.WorldModel = “models/weapons/w_pist_elite.mdl”

SWEP.Primary.Sound = Sound( “Weapon_Elite.Single” )
SWEP.IronSightsPos = Vector( 4.53, -4, 3.2 )[/lua]

Thanks! :slight_smile:

Move




 SWEP.InLoadoutFor = {ROLE_INNOCENT, ROLE_TRAITOR, ROLE_DETECTIVE}

from p228 to elites?

Oh, here we go again.

Use [lua] tags.

Thanks man, it worked