Quantcast
Channel: Latest Questions by eeveelution8
Viewing all articles
Browse latest Browse all 100

Automatic fire in weapons

$
0
0
Im currently away from home and cant test this, but im asking anyway in case i have to ask anyway later.(on mobile at school.) i've been wondering about how to do an automatic weapon, and i'm asking will the following work to make it full auto? Script isn't precise. Var isitshooting : boolean = false; Var firerate : float = 0.1; // makes the gun shoot ten times per second Function fire(){ //stuff that makes it shoot //i'll put here later //this function is the one that shoots } Function Start() { invokerepeating("checkiffiring",0,firerate); } Function checkiffiring() { If(isitshooting == true) { fire(); } } Function on.keydown(mouse0) () { //pressing the first mouse button, pretend it's correct. isitfiring = true; } Function on.keyup(mouse0) () { // releasing the mouse button isitfiring = false; } Again, im on mobile so The script has syntax errors but the jist of the script is what im wondering about

Viewing all articles
Browse latest Browse all 100

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>