AddItem
Adds an item to a player's inventory with optional metadata.
Syntax:
Bridge.Inventory.AddItem(src, item, count, slot, metadata)
Parameters:
src
(number) - Player server IDitem
(string) - Name of the itemcount
(number) - Amount to addslot
(number) - Specific slot to add tometadata
(table) - Additional item metadata
Example:
local Bridge = exports['community_bridge']:Bridge()
-- Add 1 phone with metadata
local success = Bridge.Inventory.AddItem(source, "phone", 1, nil, { number = "555-123-4567" })
if success then
print("Added phone to inventory")
else
print("Failed to add phone")
end
Last updated