Probably best to add that line inside of an execute a script action part inside of a called by other action block.
create a called by other action block somewhere, then add this to them...
pause for value "example" duration
execute a script > Interfaces["inventory"].InterfaceVisible = false
inventoryOpen = false
"example" woud be a vs value that you stored the fade time inside of. Anyway, rename the called by other action block to something like "hide_inventory".
Now edit your function script to call the called by other action you have created...
function Main.hideInventory()
if inventoryOpen == true then
local inventory = Interfaces["inventory"]
inventory:to(inventoryTransitionDuration, {InterfaceVisibility = 0})
startAction(Actions["hide_inventory"]) -- call the called by other action that handles when to hide the inventory
end
end