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

How would I finish this DataStore load?

Asked by 9 years ago

I'm having a bit of trouble understanding what I should do for loading the Values from the Datastore table to the actual IntValues in the players leaderstats.

I'm really new to Datastores so if you could please break it down for me I would really appreciate it!

01local ds = game:GetService("DataStoreService"):GetDataStore("PlayerStats2")
02 
03local getStats = Instance.new("BindableFunction")
04getStats.Name = "getStats"
05getStats.Parent = script
06 
07function saveStats(player)
08    local statz = player:FindFirstChild("leaderstats")
09    local stats = statz:GetChildren()
10    if stats then
11        local statsTab = {}
12        for i,v in pairs(stats) do
13            statsTab[v.Name] = v.Value
14        end
15 
View all 33 lines...
0
Set the leaderstats to the player.UserID's stats. iFlusters 355 — 9y
0
How would I set the leaderstats to the player.UserID's stats? PsychonautX 15 — 9y

Answer this question