closestealbag script command is used to close any non-player inventory in the HUD if the player is stealing. This means that the inventory had to be made available for stealing using
stealnpc and the player opened it via the steal icon in the HUD.
The player can also close the inventory from the HUD and the inventory will automatically close once the player is 350 units away from the inventory owner unless the player is has the Telekinesis () spell active in which case the maximum distance is 900 units.
Closing the non-player inventory also resets the steal entity.
inventory close to close any non-player inventory even if the player is not stealing.