Hmm this is like fighting fire with fire, this is why:
Security concerns:
- All they have to do is run the
GiveWeapons
scripts more often than your RemoveWeapons script. - It’s still on the client, so they could circumvent the check. I feel like this will be effective for 4-5 servers, but if it becomes widely used, hackers will try to make a bypass for this.
-
weaponFound
is static, I assume that would make it quite easy to set it to false every tick.
Code quality:
- Please store all the blacklisted weapons and ignored weapons into array/list. Right now this is quite heavy on the client, especially if you run it faster as 100ms.
- Try not to use int for the hashes, it makes the code harder to understand.
-
allowedWeaponsCheck
doesn’t need a wait nor async modifier, call it from the BaseScript tick function.
Possible improvements:
- Replicate the user weapons list to the server, this way the blacklisted weapons should never be mutable by the client.