Resource Get first click || Semiautomatic gun

Discussion in 'Spigot Plugin Development' started by ioqwert, Jun 25, 2021.

  1. Hello, I was creating a weapons plugin and needed to get the first click. It took me a long time thinking about how to do it and I finally made it.
    Today I want to share it with you.

    The concept is simple:
    Code (Text):
    time = 0
    on right click:
       if time == 0:
         shoot ()
       time = 5

    onEnable:
      runnable: with 0 delay and 1 period
         if time != 0:
           time -= 1
    If you have ever used unity it is similar to GetButtonDown()
    You need to convert it into code, just instead of using the time variable use a hashmap
     
    #1 ioqwert, Jun 25, 2021
    Last edited: Jun 25, 2021
    • Creative Creative x 1