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 4 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.

01script.Parent.MouseButton1Click:Connect(function()
02    local inventorIy = {}
03    local inventoryModule = require(script.Parent.Parent.TableOfInventory)
04    inventorIy = inventoryModule.GetInventory()
05    local inventory = {}
06    for i = 1, #inventorIy do
07        print(inventorIy[i])
08        print(typeof(inventorIy[i]))
09        table.insert(inventory, tostring(inventorIy[i]))
10    end
11    local blueprint = {"M1","HD1","CS1","BT1","CPU1"}
12    game.ReplicatedStorage.RemoteEvents.CraftComputer:FireServer(inventory, blueprint)
13end)

Answer this question