|
| 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 |
|
|
| 22 Jan 2016 06:22 AM |
| Because of the amount of request your sending |
|
|
| Report Abuse |
|
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 |
|
| |