• Insane SMG RPM(Rounds Per Minute) [FIX?]
    4 replies, posted
The SWEP share.lua file in the gamemode/entities [code] if (SERVER) then AddCSLuaFile("shared.lua") end if (CLIENT) then SWEP.PrintName = "SMG" SWEP.Author = "Richtofen" SWEP.Slot = 1 SWEP.SlotPos = 2 SWEP.IconLetter = "SMG" killicon.AddFont("weapon_smg1", "Trebuchet18", "SMG", Color(255, 80, 0, 255)) end SWEP.Base = "weapon_base" SWEP.Spawnable = true SWEP.AdminSpawnable = true SWEP.ViewModel = "models/weapons/v_smg1.mdl" SWEP.WorldModel = "models/weapons/w_smg1.mdl" SWEP.Weight = 1 SWEP.AutoSwitchTo = true SWEP.AutoSwitchFrom = true SWEP.ReloadSound = Sound("Weapon_smg1.Reload") SWEP.DrawCrosshair = true SWEP.HoldType = "smg1" SWEP.Primary.Sound = Sound("Weapon_SMG1.Single") SWEP.Primary.Damage = 5 SWEP.Primary.TakeAmmo = 0 SWEP.Primary.ClipSize = 45 SWEP.Primary.Ammo = "smg1" SWEP.Primary.DefaultClip = -1 SWEP.Primary.Spread = 1 SWEP.Primary.NumbShots = 1 SWEP.Primary.Automatic = true SWEP.Primary.Recoil = 0.8 SWEP.Primary.Delay = 1 SWEP.Primary.Force = 1 SWEP.Secondary.ClipSize = 1 SWEP.Secondary.DefaultClip = 1 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "none" SWEP.IronSightsPos = Vector (7.1437, -2.6467, 3.0592) SWEP.IronSightsAng = Vector (0.4833, 11.1981, 7.2364) [/code] Video - [video=youtube;hoL8Ahb6x0M]http://www.youtube.com/watch?v=hoL8Ahb6x0M[/video]
I'm fairly sure you have to use this: [url]http://wiki.garrysmod.com/page/Weapon/SetNextPrimaryFire[/url] In a WEAPON:PrimaryAttack( ) hook, don't you?
Where would i put this? I'm sorry in advance for any incompetence with LUA... :/
[QUOTE=Richtofen;39977791]LUA[/QUOTE] *Lua Weapon:PrimaryAttack() is a function that you define & call inside the SWep. [lua] function SWEP:PrimaryAttack() --Code & shit goes here end[/lua]
Still getting the crazy rounds per second. What i used with The Primary Attack [code] function SWEP:CanPrimaryAttack() if ( self.Weapon:Clip1() <= 0 ) then self:EmitSound( "Weapon_SMG1.Empty" ) self:SetNextPrimaryFire( CurTime() + 0.2 ) self:Reload() return false end return true end [/code]
Sorry, you need to Log In to post a reply to this thread.