Can you use OnServerEvent and OnClientEvent on one remote?

Just like tittle says,I want to know if you can use onserverevent and onclientevent on one remote

3 Likes

Yea why not. The only difference between them is that one receives data from the server and the other from the client.

2 Likes

Yeah, I try to use as little remotes as possible and instead pass many arguments through them. It helps me keep things organized by groups of actions instead of using one remote for every single action.

For example, a remote used for sending private messages should use OnClientEvent and OnClientEvent.

Yes, you can do that.

Sometimes, using more remotes can benefit your game, because fewer remotes can lead to more parameters and more code lines. The only time you use the same remote is if they require the same amount of parameters, and it fits your code without using too much “else”, and "if"s to figure out what is happening.

1 Like

Of course, that’s why you gotta keep everything within the same scope. Can’t go around using one remote for everything you do!

Yes, but if you are using this to ping an event and then get a result back, a remote function would be more appropriate.

1 Like

This is bad practice. Although it seems like a good idea due to organization, passing more arguments and having less remotes is actually less efficient because it uses more bandwidth.

Does it make a big enough difference? Haven’t heard people say it’s bad practice to do this, but if it is I’ll start using more remotes.

It isn’t such a big difference but you can check out this thread: https://devforum.roblox.com/t/what-is-better-a-single-remote-or-multiple-remotes/478908/3