|
| 02 Jun 2015 02:25 PM |
Hi guys In my game I'm going to let players create a "name" - this will be saved to a datastore. I then want to populate a scrolling list with all the names in one big list. However I have a problem - this would need to load more than the Datastore request limit so it would not work. Is there anyway I can get round this problem? Thanks |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2015 02:47 PM |
| Make a dictionary with all of the player's custom names and userIds and save it to the Global Data Store. |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2015 02:48 PM |
Then get it by doing this:
globalDS:GetAsync("customnames")[userId] |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 02 Jun 2015 03:00 PM |
Saving every player's names to the same key will quickly reach the data limit XD
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2015 03:00 PM |
| xD So is there anyway around it? |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2015 03:04 PM |
| WEll, you just put it in a dictionary and then save the dictionary. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 02 Jun 2015 03:06 PM |
Tables are stored in JSON XD
The data limit will be reached quickly if more than 200 ish people play and they all make plenty of names.
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 03 Jun 2015 02:37 AM |
| XD so it is not possible to do? ;( |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 03 Jun 2015 02:46 AM |
lol
Save a separate table for each player with their names in it.
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 03 Jun 2015 05:43 AM |
Make set intervals to save for everyone. Even if they go offline or whatever you can still save this dictionary. |
|
|
| Report Abuse |
|
|
ohno1112
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 833 |
|
|
| 03 Jun 2015 08:54 AM |
one or two things.
1. use a dictionary and player keys and their custom names as value, and just save that dictionary, every once in a while, not player-individual, that way you control exactly how much times per minute a request is made.
2. use a table with string manipulation to join player and custom names, this one is harder to do and should only be used if you need to iterate over it AND the table may contain more than just the player's names. this too will allow you to control exactly how much times per minute a request is made.
here, i will make parts of an example of the table solution.
namestbl = {}
name = game.Players[plr].Name
customname = "CUSTOMNAME"
tblstr = name..":"..customname -- if player is ohno1112 and his name is "Sumthin", this joing the string together to be "ohno1112:Sumthin"
table.insert(namestbl,tblstr)
---submitting to datastore game:GetService("DataStoreService"):GetDataStore("CustomNames"):SetAsync("a',namestbl)
--reading from datastore and extracting customnames:
a = game:GetService("DataStoreService"):GetDataStore("CustomNames"):GetAsync("a")
for i,v in pairs(a) do if game.Players:FindFirstChild(string.sub(1,string.find(v,":")-1,)) then customname = string.sub(string.find(v,":")+1,#v) --Do stuff with the customname here. end end
|
|
|
| Report Abuse |
|
|
ohno1112
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 833 |
|
|
| 03 Jun 2015 08:55 AM |
| if you still dont get it just please PM me and i can help you set things up. |
|
|
| Report Abuse |
|
|