I notice that people spams grapple hook or just use it to stay in the air the entire time. I want to know if theres a way to make it so that it can have a cool down or a reload every 3 shots.
I have tried making it so that it draws ammo everytime it shoots but it doesnt work. Probably because im missing something
These are some lines i added in:
SWEP.Primary.ClipSize = 3
SWEP.Primary.ClipMax = 20
SWEP.Primary.DefaultClip = 3
SWEP.Primary.Delay = 0.15
SWEP.PrintName = "Spiderman's Gun"
SWEP.DrawAmmo = true
SWEP.AmmoEnt = "item_ammo_pistol_ttt"
SWEP.Primary.Ammo = "Pistol"
[URL="http://pastebin.com/ALAGS45Q"]http://pastebin.com/ALAGS45Q[/URL]
self:TakePrimaryAmmo(1)?
Try putting that in your primary fire code.
Your Primary.Delay is quite low.
[QUOTE=code_gs;43501423]Your Primary.Delay is quite low.[/QUOTE]
The delay doesnt seem to function right either. It doesnt work
Have you tried setting the delay with a timer?
[QUOTE=code_gs;43501581]Have you tried setting the delay with a timer?[/QUOTE]
Dont really know what you mean by timer.
Just use this then
[code]self.Weapon:SetNextPrimaryFire( CurTime() + 2 )[/code]
[QUOTE=code_gs;43501889]Just use this then
[code]self.Weapon:SetNextPrimaryFire( CurTime() + 2 )[/code][/QUOTE]
I put that in "function SWEP:PrimaryAttack()"
But doesnt work. I have a found a way to draw ammo and its
function SWEP:PrimaryAttack()
if ( !self:CanPrimaryAttack() ) then return end
//Call the throw attack function, with the office chair model
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
self:TakePrimaryAmmo(1)
end
But when the ammo is out, you can still shoot the grapple hook
That is because it is using the think function to call StartAttack() and UpdateAttack() as a substitute. Try putting it in UpdateAttack() and StartAttack().
[QUOTE=Fortune11709;43502801]That is because it is using the think function to call StartAttack() and UpdateAttack() as a substitute. Try putting it in UpdateAttack() and StartAttack().[/QUOTE]
Alright i put it in both update attack and startattack but when i shoot, it uses up the entire clip and then the grapple hook animation gets stuck on whatever you shoot it at.
if ( !self:CanPrimaryAttack() ) then return end
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
self:TakePrimaryAmmo(1)
That is because you are using 3 ammo in 0.60 seconds.
[QUOTE=Fortune11709;43503157]That is because you are using 3 ammo in 0.60 seconds.[/QUOTE]
What? I set the delay to 0.20. After 1 click of a button, the entire clip is gone. Iv tried setting the ammo to 100 and yet, when i shoot the grapple hook, the entire gun clip disappears
Sorry, you need to Log In to post a reply to this thread.