Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't this save data script working anymore?

Asked by 9 years ago

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 answer

Log in to vote
0
Answered by 9 years ago

It's becouse it came out the new data saving system, called Data Store. It's more efficient and it even works in other places (That is in the same game). Look for tutorials out there.

0
My method works, as it saves some numbers properly. Thanks for the effort, though. ChemicalHex 979 — 9y
Ad

Answer this question