I was searching for how to indirectly DataStore tools that the player had. I found a forum from a few years ago with jjwood1600 attempting DataStoring tools. Here is the whole forum:https://forum.roblox.com/Forum/ShowPost.aspx?PostID=155263528. So I used juniorj5's codes, near the bottom, and did his correction he showed, but it won't even find the ptools. I anyway I can fix this or get a better way to do it? I've been trying to find one but I can't find out how to. juniorjfive's Code:
tools = game:GetService("DataStoreService"):GetDataStore("Tools")
print(1)
game.Players.PlayerAdded:connect(function(pj)
print(2)
local ptools = tools:GetAsync(tostring(pj.userId))
print(3)
print(4)
if ptools then
print(5)
for i, v in pairs(ptools) do
print(6)
game.ReplicatedStorage[v]:Clone().Parent = pj.Backpack
print(7)
end
end
end)
game.Players.PlayerRemoving:connect(function(pr)
local ptools = {}
for i, v in pairs(pr.Backpack:GetChildren()) do
table.insert(ptools, v.Name)
end
tools:SetAsync(tostring(pr.userId), ptools)
end)
The prints are for me to know which parts go through. It printed up to four, and nothing else shows(no errors or numbers) I constantly make stupid mistakes I'm sorry if I missed something obvious or this is outdated. Thank you in advance.

1 comment
If it prints to 4, ptools=nil. That would mean nothing is in the datastore