How to protect remote events from client injectors?

As far as I know, client injectors have access to Remote Events, just like local scripts. In my game, I use a remote event to give coins to a player after a successful purchase of a dev product. Here is a piece of code with sending an event:

RemoteName:FireServer(productId, preAmount)

Here’s what happens on the server side:

RemoteName.OnServerEvent:Connect(function(player, productId, preAmount)
 -- check if productId is in the list, get the equivalent in coins and continue if everything matches.
 player.leaderstats.Coins.Value += amount
 print("finished")
 -- if something doesn't match
 warn(player.UserId .. "wrong data" .. productId .. preAmount)
 -- add the right amount of coins
end)

The client injector can fire this remote event:

-- getting event
RemoteEvent:FireServer(1111111 (prdct id), 10000000 (preAmount))

Therefore, if the client injector adds the product id to the event, the server can easily give the player coins.

This raises the question of how to protect remotes from injectors?

Why are you using remote events to process a dev product!!???

Please look at using ProcessReceipt , and do not let the client tell the server how much the purchase is going to give - instead, either have it set as a constant value in the server script (e.g. in a dictionary), or calculate it at purchase time (for example, if you are basing it off of money per second)

1 Like

Thanks for the help, I just recently started to delve into development and don’t know all the possibilities of roblox studio yet.

Word of advice, if you need to think of protecting remote events from exploiters your doing this wrong. Only reason why you should ever consider trying to mess with remote events to prevent exploiters is to annoy them into possibly giving up.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.