Hello, I’m trying to make a gun system, and I’m just wondering, how do professional games manage fire-rate on server side? How do I make sure that an exploiter isn’t firing too many bullets? I don’t want to have to do any complicated checks on the server because it might interfere with other firing modes like a burst-fire mode (which is what I struggled with in my other gun system), just something simple that ensures their fire-rate is correct.
You can make a rate-limiter to limit how much a remote event is fired, they may also check the amount of bullets in the chamber doesn’t exceed the magazine amount. and if the ammo goes below 0.
you could save when the player last fired a bullet from that weapon, and if its before the firerate in seconds, just dont shoot. Thats what I would do at least.
This is def a good idea!
This is what I previously used, how would I handle this if I had a burst weapon? because a burst weapon basically has 2 different fire-rates, one is the fire-rate between each individual burst shot, and the other is the cooldown between each group of burst shots (how long the player has to wait before firing another burst of bullets basically)
I could probably experiment with this, just the same idea in my response above with burst weapons that it could get buggy for example and Im not sure how to handle that, thanks though!
For burst weapons, just have 2 cool downs, one for the burst and one for the cool down after the burst, check the bullets that came out didn’t exceed the burst amount(usually 3), then trigger the longer cooldown.
Hmm yes that is fair, what you could do, is every time the weapon is triggered, you could save the firerate then, so instead of saving it with each bullet that’d be shot.
Depending on how you have the client setup, you might have to change some stuff, for instance my system would just fire a bullet on the client 3 times for a burst weapon, but instead just fire it once to the server, and tell it to do a burst sorta thing.
would just fire a bullet on the client 3 times for a burst weapon, but instead just fire it once to the server, and tell it to do a burst sorta thing.
I agree with this idea, but I guess it would be difficult to implement it to handle a burst with only a remote event firing once, im not really sure how that would work, but I guess I will stick with the 2 cooldowns idea that skellyton made.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.