Hi,
My code gives the player items when they join. For some reason, my backpack stays completely empty as of testing.
Here’s what I have:
print("Started")
game.Players.PlayerAdded:Connect(function(plr)
print("1")
local mss = game:GetService("MemoryStoreService")
print("2")
local data = mss:GetQueue(" "..tostring(plr.UserId), 30):ReadAsync(1)[1]
print("3")
if data ~= nil then
print(data)
print("4")
for i, v in pairs(data) do
print(tostring(v))
print("\""..tostring(v).."\"")
if game.Workspace:FindFirstChild(tostring(v)) then
print("Item found.")
local item = game.Workspace[tostring(v)]:Clone()
print("Item cloned.")
item.Parent = plr.Backpack
print("Item moved.")
print(plr.Name)
end
end
end
end)
In the console, it prints:
1
2
3
table: random numbers and letters
4
AlmondWater
"AlmondWater"
Item found.
Item cloned.
Item moved.
TailsSlashMiles92
So everything is working, but nothing is actually in my backpack. What’s wrong?
thats that i said, but not just that. thats just a best practice, but test your game and notice if the item apears in your backpack trough the explorer.
probably you didnt put the item with a tool part. or something that phisically isnt allowing to show the item to you