Answered by
6 years ago Edited 6 years ago
In short... Yes.
If you wanted, you could have one RemoteEvent that listens for a hypothetical PacketId
. When you Fire the remote event, you would send a PacketId
as your first argument and then the rest of the data. Here's an example.
On the server it would look something like this:
1 | game.ReplicatedStorage.Remote.OnServerEvent:Connect( function (player, packetId, ...) |
4 | elseif packetId = = 2 then |
Obviously, you don't have to handle all the packetId's on the same script.
Then on the Localscript
you would do this:
1 | game.ReplicatedStorage.Remote:FireServer( 1 , stuff, moreStuff) |
5 | game.ReplicatedStorage.Remote:FireServer( 2 , stuff, moreStuff) |
If you liked this post, please upvote and accept. I'm tryin to get that rep.