Best way to constantly grab data from another client?

Currently I am making a combat game however I need to know the best method of constantly getting data from another client to update a UI.

I couldn’t decide between RemoteFunction (easier just to grab data via return) or RemoteEvent (in which I’d have to fire back to the server afterwards).

Which would you recommend out of them both (or maybe you have a better method)?

I never really use the method of getting player data via RemoteFunctions or RemoveEvents, but I’d say RemoteFunction is better just based off of what you said with it being easier to grab via a simple “return.” I always use folders in ReplicatedStorage using a main folder called “PlayerData” or “Data” to allow clients and the server to get data relatively fast both ways, but it could be slower than remotes just because I’ve never tried it before.

1 Like

Ah you see sorry I didn’t explain that part, I just need the data of their mouse, henceforth firing to their client to grab said data!

You’ll have to go through the server, either way. You can’t trigger a remote on another client from a client directly.

Client A wants to see Client B’s data.

  1. Client B needs to publish that data with FireServer
    2.The server receives that data with OnServerEvent and echos it to Client A with FireClient
  2. Client A receives Client B’s data from the server with OnClientEvent

Step 3 could also be "Client A asks the server for client B’s data when it needs it with a RemoteFunction" but if you plan to stream the data constantly, might as well save the extra network hop.

If of their mouse, probably best thing to do (at least to me idk how much else there is going on on the server) would be to somehow update the player’s mouse data on the server every few seconds, and whenever a client asks for a different player’s data, it’ll (the server will) send back the player’s data