generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: DataStore questions

Previous Thread :: Next Thread 
AntiFiter is not online. 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
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
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
earthyreuben is not online. earthyreuben
Joined: 17 Jan 2010
Total Posts: 669
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 is not online. 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 is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
11 Jan 2015 03:22 PM
b
Report Abuse
parkiet3 is not online. 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
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
11 Jan 2015 03:26 PM
1. no
2. you can queue data and save that
3. no
Report Abuse
parkiet3 is not online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
11 Jan 2015 03:29 PM
Oldvalue is the previous value saved
Report Abuse
AntiFiter is not online. 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
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
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 is not online. 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 is not online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
12 Jan 2015 09:47 AM
Remotefunctions
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image