local Products = require(workspace.Products)
local LootTables = {
["Flour"] = {
Item = "Flour",
Amount = 1
}
}
script.Parent.MouseButton1Click:Connect(function(player)
local Ingredient = game.ReplicatedStorage.SelectedIngredient.Value
local Product = Products[Ingredient]
local LootTable = LootTables[Product]
print(Ingredient)
print(Product)
print(LootTable)
local Item = LootTable.Item
local Number = LootTable.Amount
--This section--
game.ReplicatedStorage.Inventory.AddItem:FireServer(player, {
Num1 = Item,
Item1 = Number
})
end)
This script will send out those 3 variables to the server. Using print statements in that script, I get “Flour” and “1”. However, when I use this script:
game.ReplicatedStorage.Inventory.AddItem.OnServerEvent:Connect(function(args)
warn(args)
end)
All it does is print the name of the player. Why does this not work? I have other scripts like these:
game.ReplicatedStorage.Inventory.AddItem:FireClient(player, {
Num1 = Num1,
Item1 = Item1,
Num2 = Num2,
Item2 = Item2,
Num3 = Num3,
Item3 = Item3,
And
local function FillSlot(args)
print(args)
local Num1 = args.Num1
local Num2 = args.Num2
local Num3 = args.Num3
local Num4 = args.Num4
--Rest of function not shown because it's not worth thit and is VERY long.
That work just fine. Why is this issue happening now?