What’s the best way to do secure tool type checking?
Basically, you call the server to check that the player is actually using the tool they state they are and that it is not a different tool or a tool they don’t have.
I want to make sure a player using a pistol doesn’t trick the server into thinking they’re using a sniper rifle even if they have it.
This has to be server-sided and safely done from the client.
(I have no code because this is a question to ask how to create such code but not requesting the system itself coded)
So, they will raycast from the client-side and send a signal to the server to deal damage and etc to a target humanoid.
The server will check from a list of gun statistics and etc to facilitate fire rate beforehand when the player is going to prompt shooting through a RemoteFunction and get the maximum distance a bullet can travel after a shot.
Then, it fires a ray from the player’s character towards the other humanoid with a bit of leeway (5 studs maybe?) since the gun tool isn’t directly at the center of the player’s character to check if the distance is correct.
Not sure what you mean by reason but I am just trying to secure the overall process of the player doing what their gun is supposed to do correctly. I also would check if the player has a Tool in their character first before any of the checks in case they are falsely trying to “shoot another humanoid”.
Why would they be even able to equip it in the first place? Do you store them in the ServerStorage? Or you meant that they can place the Sniper from theyre backpack into theyre character in this case you should have a system that checks the character to see if they have 2 tools at the same time and if they do then kick them