Sorry the other is how to apply a locking door system in a point and click adventure game as I want the doors to not be responsive in the game until you get the key and use it to unlock the door. Plus the problem I have is using a persistent object as I am using a fake inventory where I want the item of the key to be destroyed when I pick it up and teleported into my inventory but the problem is I am not too sure how to change the persistent objects location. Then deactivate it one it's been used.
There are multiple ways of doing that.
What is often done in point and click games, is that you first have to select (and drag) the key from your inventory to the door in order for it to open.
So in the click event of the door, you would first check if its key object is selected in the inventory.
The key is best not made persistent, you'd better use someting like my previous suggestion,
keeping track of the destroyed objects in a global ds_map and destroying the objects in their create event if they appear in the ds_map.
It looks better to me not to move the objects though.
I'd just destroy the key when you click on it and update the ds_map and update the inventory object.
The inventory object would be a persistent object (placed only once in the game, in the first room)
that holds an array of object indices, of all te object you've picked up
and that holds a variable selected which can either be -1 for nothing being selected or an index of the array, indicating which item is selected.