There is a container in an empty room. When the player clicks on that container, a message box appears and an NPC appears next to the container. If the player ever opens that container again, it behaves normally and just shows its inventory, without doing anything special.
How would I script this situation?