What line do I add to an SWEP's shared.lua file to make it have a delay before refiring?

So I have downloaded an SWEP that I and my clients love and I don’t want my players on the server to be overusing it since it can cause crashes, but I do want them to be able to access it. I believe there’s a line I can add like:

SWEP.Delay = “60”

but I don’t wanna take chances and would like to know what’s the best way to do this.

Which SWep?

Look here: http://wiki.garrysmod.com/?title=SWEP for more info, but basically SWEP.Primary.Delay is the one you want to set to 60

If you’re worried about testing it, why not get a copy for your own Garry’s Mod and test it in singleplayer?

Thanks bro!

It’s not that, it’s just that I’d rather something this simple be a one-shot.

[editline]24th February 2011[/editline]

Also it’s the mortar SWEP. Adding that line doesn’t seem to work :frowning:

[editline]24th February 2011[/editline]

for SWEP.Primary.Delay to work, you must add the following



function SWEP:PrimaryAttack() 
 -- PrimaryAttack code --
    self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
end


thank you, will do.