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

Datastore spews out loading data as 'nil'?

Asked by 6 years ago

Hi, i made a skin inventory system, and i thought everything worked but it spewed out the data as 'nil', can anyone help?

01local dsservice = game:GetService("DataStoreService")
02local skinsdatastore = dsservice:GetDataStore("JuggernautSkinsDewretoz2019")
03local skinTemplate = game.ReplicatedStorage.SkinTemplate
04game.Players.PlayerAdded:Connect(function(plr)
05    plr.CharacterAdded:Connect(function(char)
06        local ownedSkins = Instance.new("Folder")
07        ownedSkins.Name = "PlayerSkins"
08        ownedSkins.Parent = plr
09        local key = "key-"..plr.UserId
10        local data = {}
11        data = skinsdatastore:GetAsync(key)
12        if data ~= nil then
13           for i,v in pairs(data) do
14            print(v.Name)
15            local nskin = game.ReplicatedStorage:FindFirstChild(v.Name):Clone()
View all 30 lines...
0
You are saving a string and trying to get the name property of it, which strings dont have theking48989987 2147 — 6y

Answer this question