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

[solved] DataStore for tools isn't working with no errors but printing things correctly, any help?

Asked by 3 years ago
Edited 3 years ago

I wanted to make a DataStore for tools. There are no errors whatsoever. Every number I print is printed in the output but the tools I was expecting isn't coming up.

01local dss = game:GetService('DataStoreService')
02local backpackds = dss:GetDataStore('BackpackStore')
03local equipped = nil
04game.Players.PlayerAdded:Connect(function(plr)
05    local backpack = plr.Backpack
06    local data = backpackds:GetAsync(plr.UserId)
07    if data then
08        for i, _ in pairs(backpack:GetChildren()) do
09            _:Destroy()
10        end
11        print(0)
12        for i,_ in pairs(data) do
13            print(12)
14            if game.ReplicatedStorage:WaitForChild('Tools'):FindFirstChild(_) then
15                print(1)
View all 55 lines...

I check the table in the DataStore plugin and it should've worked.

I deleted all tools since it was the starter tools.

I probably did something wrong getting the data but I don't know what...

Any suggestion/help is appreciated!

1 answer

Log in to vote
0
Answered by 3 years ago

dude, I DID CLONEDVAR = BACKPACK AND NOT CHANGE THE PARENT ;-;

Ad

Answer this question