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

Tables sending nil in remote events?

Asked by 3 years ago

When I send a table through a remote event, it receives nil on the server even though it isn't nil on the client.

I checked with typeof() and it says the values are strings.

script.Parent.MouseButton1Click:Connect(function()
    local inventorIy = {}
    local inventoryModule = require(script.Parent.Parent.TableOfInventory)
    inventorIy = inventoryModule.GetInventory()
    local inventory = {}
    for i = 1, #inventorIy do
        print(inventorIy[i])
        print(typeof(inventorIy[i]))
        table.insert(inventory, tostring(inventorIy[i]))
    end
    local blueprint = {"M1","HD1","CS1","BT1","CPU1"}
    game.ReplicatedStorage.RemoteEvents.CraftComputer:FireServer(inventory, blueprint)
end)

Answer this question