I made this script a while back. After a while, it didn't seem to work anymore.
What happened was it only understood I have one thing. of an array of ten.
here's the script.
function Enter(plr)
wait(.5)
plr:WaitForDataReady()
plr.leaderstats.Gems.Value=plr:LoadNumber("Gems")
plr.BCGems.Value=plr:LoadNumber("BCGems")
ge=plr.Gems:GetChildren()
for i=1,#ge do
ge[i].Value=plr:LoadNumber(tostring(i))
end
bc=plr.BCoins:GetChildren()
for i=1,#bc do
bc[i].Value=plr:LoadNumber(tostring(i))
end
end
function Exit(oplr)
ge=oplr.Gems:GetChildren()
oplr:SaveNumber("Gems",oplr.leaderstats.Gems.Value)
oplr:SaveNumber("BCGems",oplr.leaderstats.BCGems.Value)
for i=1,#ge do
oplr:SaveNumber(i,ge[tostring(i)].Value)
end
bc=oplr.BCoins:GetChildren()
for i=1,#bc do
oplr:SaveNumber(i,bc[tostring(i)].Value)
end
end
game.Players.PlayerAdded:connect(Enter)
game.Players.PlayerRemoving:connect(Exit)
It used to work.
Please help. This is the game: http://www.roblox.com/games/249848896/AE-NC-Test-Demo
Thanks!
-ds

1 comment
My method works, as it saves some numbers properly. Thanks for the effort, though.