High performance method to change weapon (Gun) bullets

Discussion in 'Plugin Development' started by wydgabriel, Aug 14, 2017.

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

    wydgabriel

    Hello guys. I'm developing a gun plugin and currently with every shot of the gun, I change in the display name of the item (gun), but this causes a certain 'flick' '(I think it's by updateInventory () and changing the item Player's hand). Would anyone know a method for me to just change the name of the weapon (where the system takes out how many bullets are left and remove as soon as the shot is given) after the player stops firing? (This with guns that shoot fast, like machine guns). I thought about creating a task whenever the player starts firing and starting a counter, and this counter in case the player is for example 1 second without firing and only after that he would take the name of the weapon the value of the counter, Subtract the counter from the number of bullets remaining, but I think this would cause a lot of performance loss (lag). Thanks for listening
     
  2. Offline

    CommonSenze

    Do you have to put the bullet count on the gun? Why not have the players level show the amount of bullets? That will stop the flicking and also might improve performence.
     
  3. Offline

    wydgabriel

Thread Status:
Not open for further replies.

Share This Page