Blockland Forums > Modification Help

Weapon that fires with delay

Pages: (1/1)

Demian:

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.

Destiny/Zack0Wack0:

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.

Demian:

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

Space Guy:

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.

Demian:

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.

Pages: (1/1)

Go to full version