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

How do I use get a datastore to save multiple children? [closed]

Asked by
Viking359 161
7 years ago

This question already has an answer here:

Data Stores(Saving Tools) With Loops?

I'm new to scripting with datastores, so this is probably a simple question, but how do I get my datastore to save all of the children of a certain data model?

01--the datastore script
02local DSS = game:GetService("DataStoreService")
03 
04local datastore = DSS:GetDataStore("GeneralSaveData", "Players")
05 
06function generateDataKey(player)
07    local ret = "uid_" .. player.userId
08    return ret
09end
10 
11function generateDataTable(player)
12    local dataTable = {
13        Gold = player.leaderstats.Gold.Value,
14        Weapons = player.weapons:GetChildren()--how would I save all of the children of weapons?
15    }
View all 46 lines...
0
you can't save instances in datastore creeperhunter76 554 — 7y

Marked as Duplicate by Goulstem

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?