I made a chest that only can be open if a player carry certain item (working)
im also trying to only let players lift items from that chest if they are carrying that item. (Not working so far)

Code:
 public override bool OnDragLift(Mobile from)
        {
          
    PlayerMobile mobile = (PlayerMobile)from;
       Container pack = from.Backpack;

        Item am = from.Backpack.FindItemByType(typeof(Diamantenegrokey));
        if (am != null)
        {
            return true;
            // from.SendMessage("WE HAVE THE KEY!");
        }
            else
        {         
             
                return false;
               //  from.SendMessage("WE DONT  HAVE THE KEY!");
            }
          
            base.OnDragLift(from);
            }

EDIT: ahhh i realized the OnDragLift refers to the chest himself not the items inside :S
 
Last edited:
You'll want to override CheckLift( Mobile from, Item item, ref LRReason rej ) in your Container's class to handle items that are contained inside of it. The argument 'item' should be the thing they try to lift out. OnDragLift happens after a successful item lift.
 
Back