OnItemAdded||doc136891

September 20, 2022

Format

local event = Entity:GetEvent("OnItemAdded")

Description

Triggered event when the entity uses item.

Callback function parameters

Type Name Introduction
Entity entity Entity with the added item
Tray tray Tray object
Item item Item object used

Code Example

local event = Event:GetEvent("OnItemAdded")
event:Bind(function(entity, tray, item)
    print(entity.. " add item " .. item .. " into " .. tray)
end)