How do i fix this datastore script bug?

How do i fix my script. It says that i need to fixed line 32 but i don’t see anything wrong. Here are some photos that can you help to understand whats the script is saying.

This is the script.
-https://gyazo.com/715db124e3ba11780d906a4e3a4e82e9

This is the output of the script.
-https://gyazo.com/5460427e68d4a99ef66389f915e80e44

1 Like

I’m pretty sure you can’t save roblox objects. You’d have to convert whatever data is in those folders to a table.

local saveData = {
    ["Gems"] = gemValue.Value,
    ["Coins"] = coinValue.Value,
    --etc...
}
DataStore:SetAsync(key, saveData)

Also, :SetAsync() only takes two arguments. The key, and the table you want to save. You can’t save 3 tables at a time like you’re doing in the code.

2 Likes

local saveData = {
[“Gems”] = Gems.Value,
[“Coins”] = Coins.Value,
[“MA”] = MA.Value
}
DataStore:SetAsync(key, saveData)

Is it like this?

1 Like

Yeah that would work fine. But you’d just have to update the rest of your code to work with your new saving format.

2 Likes

ok i will update. the script!. hope it works