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

Error in output it says "Argument 1 missing or nil - Client - InventoryHandler:8".What the problem?

Asked by 2 years ago

InventoryHandler script :

local Player = game.Players.LocalPlayer local Event = game.ReplicatedStorage.Events.Inventory.AddItem local Template = script.Template local ItemsFrame = script.Parent.Items local Items = ItemsFrame

Event.OnClientEvent:Connect(function(Player, ItemName) if Items:FindFirstChild(ItemName) then Items[ItemName].Quantity.Value = Player.Inventory:FindFirstChild(ItemName).Value else local NewTemplate = Template:Clone() NewTemplate.Name = ItemName NewTemplate.Parent = ItemsFrame

    local ItemImage = game.ReplicatedStorage.Images.ItemsFrame:FindFirstChild(ItemName)
    NewTemplate.ItemImage.Image = "rbxassetid://"..ItemImage.Value
    NewTemplate.ItemName = ItemName
    NewTemplate.Quantity += 1
end

end)

0
please put the first code (InventoryHandler script) also in a block like you did with the second script. It is so hard to distinguish lines xXMadonXx 190 — 2y
0
Also small tip: Your Error is on Line 8. I just do not know which line is line 8 right now xXMadonXx 190 — 2y
0
give us the line 8 so we can help or elseeeeeeeeeeeeeee lamgogo 56 — 2y

Answer this question