Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

When should I use remotes and how do I secure them?

Asked by
trecept 367 Moderation Voter
2 years ago

So I've begun making my first FE game, and everything has been working normally so far. I'm soon going to be adding shops to my game, and I've seen many other games use remotes for controlling shop purchases and was just wondering when I need to use a remote and what for. Also, I'm interested in how developers secure remotes so exploiters can't fire them? Thanks!

2 answers

Log in to vote
0
Answered by 2 years ago

The Wiki has a page on this with a Best Practices section. Take a look at the flow charts to see an example flow on how to properly use RemoteEvents to safely handle shop transactions.

Ad
Log in to vote
0
Answered by 2 years ago

I'm going to assume you meant remote events. They are by far the best "remote" to use, for reasons I don't need to go into.

Remotes are used mainly for when you want a local script to communicate with a server script and vise versa, with filtering enabled. So you may use them for like a local script informing a server script that the player just clicked. Another reason you may want to use them is to transfer tables between a local script and a server script, since there is no table instances like there are for bool values, number values, etc.

As for a way to secure them, there are many ways. Presuming you know how to use them, you can fire a remote event with one parameter of it being some sort of password, and have the script receiving it check to see if that variable is valid. If you want, you can make it so that the script that fired it sent the player it fired from (assuming its local script to server script) and kick that player if the variable is invalid.

Another way to secure them is for a server script to create a remote event and let the local script fire that one, and destroy it once it's been fired. I don't recommend this one as it may cause lag and is easy to get pass.

Over all the first one is the better choice, since hackers will have to access your place through studios to see it even has a "password" and figure it out. There may be better ways, but these were the only ones that would come to mind.

0
Do I need to use remotes? I have some local scripts and they work fine without remote events so far. trecept 367 — 2y
0
You use Remote Events if you're trying to communicate with the server. Client to server communication, that's what Remote Events and Remote Functions do. Use Remote Event if you're trying to communicate with the server, and want replication to all clients. For instance, an object appearing from the player. liteImpulse 47 — 2y

Answer this question