I'm trying to make this Data Store save a player's backpack, and load it when they come back, but nothing happens, nothing returns with printing, no errors in the output. (Ignore the Kills part, it works fine)
if player_store:GetAsync("Kills") then
Kills.Value = player_store:GetAsync("Kills")
else
Kills.Value = 0
end
if player_store:GetAsync("Weapons") then
for i,v in pairs (player.BackPack:GetChildren()) do
v:remove()
end
local Weapons = player_store:GetAsync("Weapons")
for i in Weapons do
game.Lighting:FindFirstChild(i):Clone().Parent = player.BackPack
end
end
end)
game.Players.PlayerRemoving:connect(function(player)
player_store = DataStore:GetDataStore(player.userId.."Z")
if player_store:GetAsync("Kills") then
player_store:SetAsync("Kills", player.leaderstats.Kills.Value)
else
player_store:SetAsync("Kills", player.leaderstats.Kills.Value)
end
if player_store:GetAsync("Weapons") then
print 'its here'
local Weapons = {}
for i,v in pairs (player.BackPack:GetChildren()) do
Weapons[v] = v
end
player_store:SetAsync("Weapons", Weapons)
else
local Weapons = {}
for i,v in pairs (player.BackPack:GetChildren()) do
Weapons[v] = v
end
player_store:SetAsync("Weapons", Weapons)
end
end)
game.Close:connect(function() wait (5) end)

2 comments
I remember helping you with something like this a week or so ago :{
Well now im trying to table within it, what you helped me with works