AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 10 Jan 2015 09:27 PM |
1. Can they be called form a Local Script? If so, will I probably want to use a local script to prevent lag on a large scale? 2. What sort of things can exceed data limits? Even on front page games, let's say if everyone left at once in.. I don't know, Mad Murderer, would all the data be throttled due to the request limit (per minute, right)? 3. Since there isn't an obvious example on the wiki, would saving a value go something like this: local DataStore = game:GetService("DataStoreService"):GetDataStore("Points") game.Players.LocalPlayer.Removing:connect(function(player) local key = "user_" .. player.userId DataStore:UpdateAsync(key, function(oldValue) -- is oldValue a host of a value? (It can be named anything?) newValue = script.Parent.MyString.Value return newValue end) end)
-- If I had many of the same value in one player, for example slots like in apoc rising, how would you do this? A special key? |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2015 10:10 PM |
they can't be used in local scripts
to prevent from exceeding the request limit, save tables, then load their values into the instances using loops |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2015 10:13 PM |
| Data Stores cannot be called from a local script. However you can call a server script from a local script with a remote event or function and have it do it for you. Also, when I want to make a key for want user, I use "User_" plus their id and you may find this useful since a their Id is unchanging. |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 11 Jan 2015 01:40 PM |
@Accomplishable
I'm not exactly sure what you mean by that. (Since I've never used DataStores)
@above
How exactly do you view your datastore list? Like input "loaddata" or something? |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
| |
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
|
| 11 Jan 2015 03:26 PM |
| Pcall on datastores work to check if it is uploaded |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2015 03:26 PM |
1. no 2. you can queue data and save that 3. no |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
|
| 11 Jan 2015 03:29 PM |
| Oldvalue is the previous value saved |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 11 Jan 2015 04:22 PM |
| If I wanted to save a value, like maybe a player has a clicks value in playergui, what would it look like? |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2015 04:38 PM |
1. Even though it seems like it has already been established that you cannot save in localscripts, I will repeat it anyways: you cannot save in localscripts. This is to prevent hackers from changing things in the datastore. Also I'm not really sure what you mean by reducing lag.
2. The currently allowed requests per minute for SetAsync is 60 + numPlayers * 10. This means that you can make up to 10 changes to the datastore per minute for each player plus 60 extra requests, so this really shouldn't be an issue.
3. What do you mean there isn't an obvious example?(http://wiki.roblox.com/index.php?title=SetAsync) |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 11 Jan 2015 04:41 PM |
@Freescriptmaker
It doesnt have an example of like values in a player. Like script.Parent.Value or something |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
| |
|