so i was following this video :https://www.youtube.com/watch?v=HQQOgbkm14A
i did everything but it did not worked
local dataStoreService = game:GetService("DataStoreService") local datastore = dataStoreService:GetDataStore("BackpackSave")
game.Players.PlayerAdded:Connect(function(player)
pcall(function()
local tool = datastore:GetAsync("User-"..player.UserId)
if tool then
for i,v in pairs(tool) do
local ToolFound = game.ReplicatedStorage.Items:FindFirstChild(v)
if ToolFound then
ToolFound:Clone().Parent = player.Backpack
ToolFound:Clone().Parent = player.StarterGear
end
end
end
end)
end)
game.Players.PlayerRemoving:Connect(function(player) pcall(function() local toolsSave = {} for i, tool in pairs(player.Backpack:GetChildren()) do if tool then table.insert(toolsSave,tool.Name) end end datastore:SetAsync("User-"..player.UserId, toolsSave) end) end)
im not asking for a free script, i just wanna know how to make it? my situation is that i made shop where i can buy items, when i buy item it will be added in my inventory but after i rejoin it dissapears i need help sorry for bad english