• SWEP not firing?
    3 replies, posted
I'm very new to lua and I'm working on an ak47 swep for practice. I have everything appearing fine and all, the only problem is, it isnt firing. Here's the code I'm using: if ( SERVER ) then AddCSLuaFile( "shared.lua" ) SWEP.HoldType = "ar2" end if ( CLIENT ) then SWEP.PrintName = "Destroyers AK47" SWEP.Author = "Destroyer" SWEP.Slot = 3 SWEP.SlotPos = 1 SWEP.IconLetter = "w" killicon.AddFont( "weapon_ak47", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) ) end SWEP.Base = "weaponcsbase" SWEP.Spawnable = true SWEP.AdminSpawnable = true SWEP.ViewModel = "models/weapons/v_rif_ak47.mdl" SWEP.WorldModel = "models/weapons/w_rif_ak47.mdl" SWEP.Weight = 5 SWEP.AutoSwitchTo = false SWEP.AutoSwitchFrom = false SWEP.Primary.Sound = Sound( "AK47-11.wav" ) SWEP.Primary.Recoil = 1.5 SWEP.Primary.Damage = 30 SWEP.Primary.NumShots = 1 SWEP.Primary.Cone = 0.02 SWEP.Primary.ClipSize = 25 SWEP.Primary.Delay = 0.07 SWEP.Primary.DefaultClip = 50 SWEP.Primary.Automatic = true SWEP.Primary.Ammo = "smg1" SWEP.Secondary.ClipSize = -1 SWEP.Secondary.DefaultClip = -1 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "none" SWEP.IronSightsPos = Vector( 6.1, -7, 2.5 ) SWEP.IronSightsAng = Vector( 2.8, 0, 0 )
That is because you never gave it a firing method, try to use SWEP:PrimaryAttack()
[QUOTE=timpo204;40119241]That is because you never gave it a firing method, try to use SWEP:PrimaryAttack()[/QUOTE] I added that but now it isnt appearing on the Weapons tab :/ Made it reappear but still isnt firing.
Does the weapon base even exist?
Sorry, you need to Log In to post a reply to this thread.