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

Having trouble loading Stats. How should i fix this? (Uses Tables)

Asked by 4 years ago

So i recently tried making stats using Tables and using DataStores with them and everything works perfectly but when i use a for loop to create the stats it doesn't load the stats correctly.

for StatName, Value in pairs(StatsValues) do
        local svalue = Instance.new("IntValue",stats)
        svalue.Name = StatName
        svalue.Value = DataStoreService:GetDataStore(Store):GetAsync(Player.UserId) or Value
    end

From what i've heard it's because it only loads the data from the very first value of the table.

What i mean is: I have 3 or more stats in one table. the first stat is set to false but the rest is set to true. It'll only load the data of the first stat saying every value is false

0
Are you testing it in studio? I believe testing in studio doesn't save anything to datastores. 7GB0 0 — 4y
0
Actually, they do if you don't set any other parameters FrankyLovesGames 35 — 4y

Answer this question