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

table expected, got nil?

Asked by 1 year ago
for _, part in pairs(folder:GetChildren()) do
        if part.Owner.Value == player.Name then
            part.Parent = workspace:WaitForChild(player.Name.."savedata")
        end 
    end

    wait(1)
    local obj = workspace:WaitForChild(player.Name.."savedata")
    print(obj:GetChildren())

    local result, problem = pcall(function()
        BuildData:SetAsync(tostring(game.Players:FindFirstChildOfClass("Player").UserId), Save.Encrypt(obj:GetChildren()))
    end)

    if not(result) then
        error(problem)
    end

for some reason it keeps printing

  19:52:04.601  ServerScriptService.BuildHandler:44: ReplicatedStorage.Serializer:41: invalid argument #1 to 'pairs' (table expected, got nil)

but the print(obj:GetChildren()) part works. it prints a table with all its content.

0
Can you show the entire script, both Server and Client? I'm curious. T3_MasterGamer 2189 — 1y
0
What's with the encryption? It's totally overkill. Ziffixture 6913 — 1y
0
honestly i want to know how to save parts in a folder to one person Toastitions 11 — 1y

Answer this question