Available capacity||doc135677

September 20, 2022

Format

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

Description

Returns the usable capacity of the tray.


Value Returned

type Description
int effective capacity


Code Samples

On the server side of the entity templatemount script, add the registration of this type of entity object tray when adding itemCallback, output the available capacity of the tray

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