By Axanon
Sometimes it can be problematic if a key is maxload 1 and is being stored in a house. To prevent this situation, I came up with an easy little script to stop this from happening. Just attach it to the house (or any room you don't want keys dropped in).
Code:
Name: '[R:VARIOUS] Disallow Storing Keys in Houses'
Trigger Intended Assignment: Rooms
Trigger Type: Drop , Numeric Arg: 100, Arg list: None
Commands:
if %object.type% == KEY
  %send% %actor% The storing of keys in houses is not allowed.
  return 0
end
if %object.type% == CONTAINER
  set i %object.contents%
  while %i%
    set next %i.next_in_list%
    if %i.type% == KEY
      %send% %actor% You may not drop containers here while there is a key inside.
      return 0
    end
    set i %next%
  done
end
 
NOTE: A good practice is to ensure keys load more than one instance since key storage in a house is no different from a character always idling with keys to hoard them. Single instance keys are a bad idea since if a player dies behind a door with the only key in their corpse they have no way to get back. Also, keys should always be the first dependent object loaded to a mob so they don't rely on other equipment loading to the mob prior to it.
If this was helpful please 
    vote
 or leave a 
    review 
for TBA.