Advertisement
RedDeadlyCreeper

FireRate limiter

Dec 29th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. @name FireRate Limiter V1.0
  2. @inputs Fire
  3. @outputs FireOut Canfire
  4. @persist Delay
  5. @trigger
  6. interval(100)
  7. if(first())
  8. {
  9. Delay=0.005*1000
  10. Canfire=1
  11. }
  12. FireOut=0
  13. if(Fire&Canfire)
  14. {
  15. FireOut=1
  16. Canfire=0
  17. timer("Reload",Delay)
  18. }
  19. elseif(clk("Reload"))
  20. {
  21. Canfire=1
  22. stoptimer("Reload")
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement