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: Data store

Previous Thread :: Next Thread 
arshiaslaya is not online. arshiaslaya
Joined: 04 Nov 2012
Total Posts: 2670
22 Jan 2016 06:17 AM
Hi can someone help me with this script? (Not my script)-Dave2011's
I remember using it a long time ago and I think it worked worked but now it just seems to be able to save 1-2 values at most.

local ds = game:GetService("DataStoreService"):GetDataStore("dataisnot12321312")
stats={"Cash","M1991StoredAmmo","ClassicSword","ClassicSwordDamage","DarkHeart","DarkHeartDamage","M1991","M1991Damage","Soul","M4","M4Damage","M4StoredAmmo","MP7","MP7Damage","MP7StoredAmmo","USP45","USP45Damage","USP45StoredAmmo","MaxHealth","Secondary","Primary"}
game.Players.PlayerAdded:connect(function(plyr)
local a=Instance.new("NumberValue")
a.Parent=plyr
a.Name="leaderstat"
for i=1,#stats do
local stat=Instance.new("NumberValue")
stat.Parent=a
stat.Value=0
stat.Name=stats[i]
end
local child=plyr.leaderstat:GetChildren()
for i=1, #child do
child[i].Value=ds:GetAsync(plyr.userId..child[i].Name)
end
end)

game.Players.PlayerRemoving:connect(function(plyr)
local child=plyr.leaderstat:GetChildren()
for i=1, #child do
child[i].Value=ds:SetAsync(plyr.userId..child[i].Name,child[i].Value)
end
end)
Report Abuse
checkplate is not online. checkplate
Joined: 05 Jan 2016
Total Posts: 1379
22 Jan 2016 06:22 AM
Because of the amount of request your sending
Report Abuse
iSymon is not online. iSymon
Joined: 19 Nov 2011
Total Posts: 1023
22 Jan 2016 06:28 AM
ikr, he got the GetAsync method in a for loop which loop through the leaderstats. lol
Report Abuse
arshiaslaya is not online. arshiaslaya
Joined: 04 Nov 2012
Total Posts: 2670
22 Jan 2016 11:41 AM
Thanks I fixed it.
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