Gun plugin / help with delaying code

Discussion in 'Plugin Development' started by space1188, Feb 7, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    space1188

    Im making a gun plugin. i want a delay between shots. so he would shoot once then 2 or 3 sec later he can shoot again. how would i do this
     
  2. Offline

    wesley27

    @space1188 Get the current time right after he shoots. Then, when he tries to shoot again, get the time again. If the new time is less than 2 or 3 seconds after the first time, cancel his shot. If it is greater, he shoots again.
     
  3. Offline

    yupie_123

    @space1188
    You could also add them to a cooldown list and use a delayed task to remove them from said list.
     
  4. Offline

    mcdorli

    Yeah, but that's inefficient
     
Thread Status:
Not open for further replies.

Share This Page