rendered paste bodyif ( SERVER ) then AddCSLuaFile( "shared.lua" ) SWEP.HoldType = "smg" endif ( CLIENT ) then SWEP.PrintName = "Custom Spawn" SWEP.Author = "Durundal" SWEP.Instructions = "Left Click:Spawn" SWEP.Slot = 6 SWEP.SlotPos = 1 SWEP.IconLetter = "a" SWEP.ViewModelFOV = 70 killicon.AddFont( "weapon_ak47", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) ) endSWEP.Base = "weapon_cs_base"SWEP.Spawnable = falseSWEP.AdminSpawnable = trueSWEP.ViewModel = "models/weapons/v_mosin.mdl"SWEP.WorldModel = "models/weapons/w_mosin.mdl"SWEP.ViewModelFlip = falseSWEP.Weight = 1SWEP.AutoSwitchTo = trueSWEP.AutoSwitchFrom = trueSWEP.ForceApply = 60 -- Amount of force to give to phys objectsSWEP.TracerFreq = 1 -- Show a tracer on every x bullets SWEP.Primary.Sound = Sound( "weapons/k98_shoot2.wav" )SWEP.Primary.Recoil = 2SWEP.Primary.Damage = 0SWEP.Primary.NumShots = 1SWEP.Primary.Cone = 0.01SWEP.Primary.ClipSize = 5SWEP.Primary.Delay = 1.2SWEP.Primary.DefaultClip = 7000SWEP.Primary.Automatic = falseSWEP.Primary.Ammo = "smg1"SWEP.Secondary.ClipSize = -1SWEP.Secondary.DefaultClip = -1SWEP.Secondary.Automatic = falseSWEP.Secondary.Ammo = ""SWEP.IronSightsPos = Vector( -5.15, -11, 2.25 )SWEP.IronSightsAng = Vector( 1.25, 1.5, -5.5 )function SWEP:PrimaryAttack()self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay ) self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay ) if ( !self:CanPrimaryAttack() ) then return end self.Weapon:EmitSound( self.Primary.Sound ) self:CSShootBullet( self.Primary.Damage, self.Primary.Recoil, self.Primary.NumShots, self.Primary.Cone ) self:TakePrimaryAmmo( 1 ) self.Owner:ViewPunch( Angle( math.Rand(-0.2,-0.1) * self.Primary.Recoil, math.Rand(-0.1,0.1) *self.Primary.Recoil, 0 ) ) if(SERVER) then local SpawnPos = HitPos self.Owner:SetNetworkedVector( "SpawnPos", SpawnPos ) end if CLIENT then local SpawnPos = self.Owner:GetNetworkedVector("SpawnPos") if SpawnPos.x == 65536 then return end local spawn = {} spawn.x = SpawnPos.x spawn.y = SpawnPos.y spawn.z = SpawnPos.z spawn = Vector(spawn.x,spawn.y,spawn.z) local ang = Angle(0, 0 , 0) local effectdata = EffectData() effectdata:SetOrigin( spawn ) effectdata:SetNormal( ang:Up()) effectdata:SetMagnitude( .5 ) effectdata:SetScale( .25 ) effectdata:SetRadius( .5 ) util.Effect( "ManhackSparks", effectdata ) endendfunction SpawnConnect( pl ) pl:SetNetworkedVector( "SpawnPos", Vector(65536, 65536, 65536))endif(SERVER) then hook.Add( "PlayerSpawn", "TOOLCSpawner", SpawnHook ) hook.Add( "PlayerInitialSpawn", "TOOLCSpawner2", SpawnConnect ) concommand.Add("userspawnreset",SpawnConnect)end