So I have started making a Roblox shooting game. Instead of doing LocalScript reducing the targets humanoid health everytime they hit the enemy, I’ve decided to make a mechanism to avoid players killing eachother at once.
So this is how It works:
When a player shoots someone, the player’s localscript sends a petition (with a RemoteEvent) to deal damage to their target. However, there may be situations where the script gets 2 petition at once. For example, it may get 2 petitions about 2 players that have dealt mortal damage to eachother (can happen because of latency).
In this situation, I should program the priority of each petition, but I’m stuck between 2 options:
- By time: With the tick() function, I could check which player have fired first. If one of the players sent the petition with less tick() time, then the other petition would be discarded, since in that moment, the other player would be dead. The only issue is that this can be abused by players that have tons of lag, which can kill players that seem to be frozen.
- The petition that reached faster: The first petition will be processed first, but It may be quite unfair for people with slow computers/internet.
So which option do you consider better? (Sorry for my bad english)