dimanche 31 mai 2015

how to wait for a few seconds before starting a function

i want to reload a gun. When R pressed. I want it to wait 3 seconds before loading the gun. Is there a simple way to do this?


if (event.keyCode == Keyboard.R)
            //wait(4 seconds)

                           // start reloading

Aucun commentaire:

Enregistrer un commentaire