Author Topic: Weapon that fires with delay  (Read 368 times)

How would I make a weapon that only fires every 2 seconds when you are holding down the fire button? I've been messing with the stateTimeoutValue but nothing seems to work.

Add a cooldown state.
Also, you might want to think about using script as firing limits using states can be avoided by re-equipping the weapon.

Do you happen to know a weapon that has this? So I could poke around a bit to see how it works.

Ephialtes' Shotgun does both of these, although re-equipping the weapon and firing still does the sound/particle effects with no bullets so it looks odd.

Okay then. I got the delay down with an additional state has a timeout after which it goes back to the fire state. Now how would I prevent re-equipping exploit? (Spamming the inventory key.)

Edit: Well that was almost disappointingly easy to do. Just adding a small timeout to the very first state "Activate". I'm all good, for now.

Edit2: 0.18 appears to as fast as you can set it while still preventing the exploit.
« Last Edit: April 02, 2011, 11:30:02 AM by Demian »