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

I have trouble getting data into multiple folders and intvalues?

Asked by 4 years ago
Edited 4 years ago

I AM TRYING TO SAVE A INTVALUE WHICH IS IN 3 MULTIPLE FOLDERS BUT THERE ARE NO ERRORS IN THE OUTPUT AND IT DOES NOT SAVE

AND WHEN I REMOVE The PCALL IT ERRORS SAYING THAT SOMETHING IS NOT A VALID MEMBER

    local DataStoreGottenData = DataStoreOfAllStatsAndCurrency:GetAsync(Player.UserId)
    local PlayerFolder = DataStoreFolder[Player.UserId]


    for i,v in pairs(DataStoreGottenData) do
        local S,E = pcall(function()
            PlayerFolder.CurrencyFolder[i].Value = v
            PlayerFolder.StatsFolder[i].Value = v
            PlayerFolder.ClassFolder[i].Value = v




        end)

    end

The data saving works perfectly fine

I saved it like this

        TableToInsert[v.Name] = v.Value

to go in more detailed

when I print the got async it prints

Coins, 0
Diamonds, 0 
Health, 0 

But I dont understand how I can get these 3 values into 3 different folders where each of them are in a seperate folder

can anyone help?

1 answer

Log in to vote
0
Answered by 4 years ago

Have you tried making it wait until the player has loaded in? Maybe that is why you get the not valid member error

0
I have PlayerAdded Overseer_Prince 188 — 4y
Ad

Answer this question