Dear Developer Community,
I am writing a new type of game, one that I have never attempted on Roblox previously. Normally my games do not involve any damage to players, other than perhaps falling off the main board and respawning. I am building a game that involves damage using tools. This is my 7th game in three years and, while I have a lot of experience, I am still learning every day that I work in the environment.
Normally, I am processing any of my important code such as rewarding coins or gems, using a method that involves generating a temporary key for that specific action and then destroying the key after the action is completed. I have been doing this for almost three years and it has kept server level data integrity intact. I do tend to keep my code in two major files, one for the client and one for the server, since I am more versed in other languages that follow that Client-Server model. I am trying to get away from that and use Roblox in the way that I believe other developers are approaching problems.
The scripts I am using are all regular scripts, which I have always assumed are server level scripts. Here are the steps I am taking, when a tool deals damage and problems that I am facing.
- The tool’s action is triggered and I test for a NPC or another player.
- The Script Calls a Remote Function on the Client.
- The Client Remote Function Requests a Temporary Key from the server.
- The Client Remote Function Calls to the Server Remote Function.
- The Server Remote Function verifies the Temporary Key, and if not, kicks the player.
- The Server Remote Function makes modification to the Database, issuing whatever is being rewarded to the Player such as coins or gems, etc.
- The Server Returns a value to the Client Remote Function that Called it.
- The Client Remote Function updates the Player GUI or gives some other feedback to the player of their reward.
- The Client Remote Function returns control to the tool and the tool finishes processing and “reloading” or “recharging”
The main problem I am facing is that any time I make the reload/recharge process less than 1 second in length, I can see that when I am hitting or shooting another player or a NPC that while the action is being taken, I am not always doing damage on subsequent hits.
My question, now that I have probably lost your attention due to being long winded,is to attempt the following.
- The Tool’s action is triggered and I test for a NPC or another player.
- Since the Tool Script is a regular script, I can reference my database module here and make modifications to the Database, issuing whatever is being rewarded to the Player such as coins or gems, etc.
- I call a Client Remote Event which updates the Player GUI or gives some other feedback to the player of their reward.
- The Tool finishes processing and “reloading” or “recharging”
By removing 5 steps in the process, I can get a faster turn around time for each shot or hit I dole out, making my game faster and more responsive for the player by removing multiple remote function calls out to the client, the server and back again.
My main concern is now exploiters that could take advantage of my not generating any temporary keys. Are these regular scripts available to them? Since I am not really calling any server level remotes, is there even a back door open to them?
Thank you, in advance, for taking the time to read this and offering any thoughts you might have.
Regards,
Tweetclean