Hi, today i was trying to replicate user data to its client, so i made a bunch remote events wrapped in a folder on replicatedstorage and connect them to some scripts.
but then i realized that if i added more things to the data template (user data), it would be ALOT of code on the server-side script, so i made to send and request data through remote events and functions, but i didnt know how to make the code or should i send a dictionary (table) or just the wanted data value.
so for you guys that maybe are confused, the only wanted question is, how can i replicate player data when its changed or requested?
You can have a single RemoteFunction return the players data to the client.
-- (Examples)
-- From the client
local localData = RemoteFunction:InvokeServer()
-- From the server
RemoteFunction.OnServerInvoke = function(player: Player)
-- Get the player's DataStore/Data information
--...
return PlayerData -- return whatever data is associated with the player
end