In my inventory system, I am trying to get what player has in his/her inventory by a RemoteFunction
from a client to the server but I am getting two errors which tell me that I am not sending a string
.
My details:
My Code:
Client Side:
local function setCateItems(plyr, categ)
local objectsOfCateg = getPlayerInventoryfunction:InvokeServer(plyr, categ)
clearList()
for i, object in pairs(objectsOfCateg) do
local cloneItem = object:Clone()
table.insert(objectsOfCateg, cloneItem)
local cloneTemplate = template:Clone()
cloneTemplate.Name = object.Name
cloneTemplate.Amount.Text = object.Cost.Value
cloneTemplate.Background.ImageColor3 = categoriesColors[categ.Name].CellBackground
cloneTemplate.Visible = true
cloneTemplate.Parent = inventoryGUI.ItemsFrame
end
end
Server Side:
getPlayerInventoryfunction.OnServerInvoke = function(plyr, categ)
return players[plyr].Inventory[categ.Name]:GetChildren()
end
Player when invoking the remote function