Kampfkarren / Roblox

Scripts and stuff I wrote for Roblox. Documentation is little to none as these are just stuff I took from my game that I thought I could share.
https://kampfkarren.github.io/Roblox/
Other
284 stars 78 forks source link

How to save a UNIQUE table in DataStore2 (regardless of the player)? #105

Closed rogeriodec closed 4 years ago

rogeriodec commented 4 years ago

Currently in DataStore2 the data is saved for each player. Ex: local myData = DataStore2("myData", player).

In addition to the data for each player, I would like to store ONE generic table that will serve ALL players ( a dictionary conversion data, for compressing all data for the player).

I tried to use a "generic" player (zero) but I got an error: ServerScriptService.DataStore2:483: DataStore2() API call expected {string dataStoreName, Instance player}, got {string, number}.

How to save this unique table in DataStore2 for (not using the player)?

Kampfkarren commented 4 years ago

I'm not sure this is a good idea for Roblox in general. You're going to have issues where multiple servers set the data, and override each other, or I believe Roblox will also throttle all the servers trying to access the same key.

You'd be better off designating this to some personal external service.