owner||doc135671

September 20, 2022

Format

 tray:owner()
  • The class to which the function belongs:tray

Description

Get the tray instance owner.


Value Returned

type Description
Entity owner


Code Samples

On the server side of the entity templatemount script, add the registration of this type of entity object tray when adding itemCallback, get the owner of the tray instance

Trigger.addHandler(this:cfg(), "SETTLE_ITEM", function(context)
    local entity = context.obj1
    local tray = context.tray
    local owner = tray:owner()
    print(owner)
end)