22.03.2019, 17:04
Quote:
Just check OnPlayerKeyStateChange
![]() There you can check if he presses Q and can instant check if the weapon got changed ![]() So you dont need unnecessary checks ![]() |
You need to use a timer or something similar for this.
If OnPlayerUpdate is called too often in your opinion, use a timer with a higher interval.
I'd suggest starting with a 500ms timer. If it skips too many weapon changes, lower it until it works as expected.
OnPlayerUpdate is the fastest detection you can do ("fastest" as of reaction time) since it's called everytime the weapon ID gets synced, so you cannot technically check it more often than that (you can check it, but the value won't change until the next update).