Hey there developers!
What a fine day it was for me, but as always I encountered an issue, that’s fine, we can fix it!
As I’m only now getting serious when it comes to scripting, I have a passion to learn everything I can about learning how to secure my games as much as I can early on. I’ve been an exploiter years ago, so I know what they can do; even the most popular and well developed games can’t exactly secure everything.
I have made a small practice project, learning and making a shop system. Very basic, nothing fancy. I have a shop keeper with a proximity prompt attached to it, a server script listens to the service and checks which prompt was triggered and if it was from the shop keeper, it fires some remote events towards the client that triggered it so it can open the GUI… pretty standard stuff.
It all works, the cash system works. The only thing that doesn’t work is the fact that the user can spam the shop, buying items whenever they wanna (as long as they have enough cash for it). So what do you do about this? You introduce a debounce variable. But wait, hold up, the whole script that handles buying is a server script. If I add a debounce var there, it will affect all players, which ruins the experience. Doing it on a LocalScript wont work, it can be exploited, so what’s the best way to prevent shop spam? Got any ideas? Hopefully!
– Happy coding