Client
These exports can only be used on the client-side. Make sure to use them in your client-side script files.
I do not recommend using these exports on the client-side. Most of the time these exports just trigger a callback with the server exports. You make your script more vulnerable if you are using these exports. They are intended for server-side use only.
CanCarryItem
exports.it_bridge:CanCarryItem(item, amount)
- item:
string
: The item name. - count:
number
: The amount of items.
Checks if the player can carry the specified amount of items. Returns true
if the player can carry the items, false
otherwise.
Example
local canCarry = exports.it_bridge:CanCarryItem('paper', 10)
print(canCarry)
GetItemCount
exports.it_bridge:GetItemCount(item, metadata)
- item:
string
: The item name. - metadata?:
table | nil
(optional): The item metadata.
Returns the amount of the specified item the player has in their inventory.
Example
local itemCount = exports.it_bridge:GetItemCount('paper')
print(itemCount)
HasItem
exports.it_bridge:HasItem(item, amount, metadata)
- item:
string
: The item name. - count:
number
: The amount of items. - metadata?:
table | nil
(optional): The item metadata.
Checks if the player has the specified amount of items. Returns true
if the player has the items, false
otherwise.
Example
local hasItem = exports.it_bridge:HasItem('paper', 10)
print(hasItem)
GiveItem
exports.it_bridge:GiveItem(item, amount, metadata)
- item:
string
: The item name. - count:
number
: The amount of items. - metadata?:
table | nil
(optional): The item metadata.
Gives the player the specified amount of items. Returns true
if the items were successfully given, false
otherwise.
This function will not check if the player can carry the items. Make sure to use the CanCarryItem
function before giving items if you want this check.
Example
local success = exports.it_bridge:GiveItem('paper', 10)
print(success)
RemoveItem
exports.it_bridge:RemoveItem(item, amount, metadata)
- item:
string
: The item name. - count:
number
: The amount of items. - metadata?:
table | nil
(optional): The item metadata.
emoves the specified amount of items from the player's inventory. Returns true
if the items were successfully removed, false
otherwise.
Example
local removed = exports.it_bridge:RemoveItem('paper', 10)
print(removed)
GetItemLabel
exports.it_bridge:GetItemLabel(item)
- item:
string
: The item name.
Returns the label of the specified item.
Example
local label = exports.it_bridge:GetItemLabel('paper')
print(label)