How to have a remote event for each player and have all of them be read

Hey guys,

I’m making an inventory system for my game where all data is stored on the server for security. With the limitations of remote events and the size of the servers, it’s not feasible for this to be handled in one remote event. How would I make one for each player and be able to dynamically connect to all of them? Alternatively, is there just a better way to do an inventory system?

Why is it not feasible for it all to be handled in a single remote event? What operations are you trying to do?

I suggest you use some type of clone system, using a player’s inventory but connecting each one individually to the player’s data. In my experience remote events have not always worked out the best for me in terms of saving data, so I suggest using functions instead or a special kind of service that makes it easier to save data.

Remote events have a limit of 20 per second. That doesn’t work for a server of 20-30 players that may be trying to get data multiple times per second.

I can’t find anything that says they have a 20/s limit, and my game fires a lot more remote events than 20 every second and it’s fine. Creating a new event for every player is way more unoptimized than just using the same event to send data to the player directly

What’s your use case? Because I can probably recommend a better solution

No. Remote events have a limit of about 30 I think. Roblox has added an unreliable remote event that would not limit itself but it does not provide the guarantee that the remote will actually fire.

Remote events don’t have a limit afaik, just tested running 1000 events in a while loop and they all sent in 0.1~ seconds

server code:

local remoteEvent = game.ReplicatedStorage.RemoteEvent
task.wait(5)

local amount = 1000
local timestamp = workspace:GetServerTimeNow()
for i = 1, amount do
	if i == amount then
		remoteEvent:FireClient(game.Players.DataSigh, i, timestamp)
		continue
	end
	remoteEvent:FireClient(game.Players.DataSigh, i)
end

client code:

local remoteEvent = game.ReplicatedStorage.RemoteEvent

remoteEvent.OnClientEvent:Connect(function(numberSent, serverTimestamp)
	print("received: ", numberSent)
	if serverTimestamp then
		print("Finished in: ", workspace:GetServerTimeNow() - serverTimestamp, " seconds")
	end
end)

results:

20 per second means unhandled requests