How to change an object with another object

I am new to this and all, I did some scripting before but I don’t know everything so please be patient.

So what I want is this:

-when you pick up an item (in this case a chip) the player holds it and then walks towards a cardreader, you are supposed to click on the cardreader and then the cardreader changes into a cardreader that has been unlocked.

so in this case I assume I need to have a script that changes the cardreader into the other cardreader I made that shows that the cardreader is unlocked when I click on it while holding the chip.

but how am I supposed to do that. And is it possible. I work with unity javascript.

(I already have the pick up script which is working)

Thanks in advance.

I would suggest you have a parent gameobject called cardreader and to that object you parent two objects, one for being unlocked and one for locked. Make sure both of them are set to the same position and disable the unlocked gameobject.
Then in your script you can do something like this:

var unlocked : GameObject;
var locked : GameObject;

void UnlockReader()
{
    unlocked.active = true;
    locked.active = false;
}

Then attach a script with that stuff (and the conditions for unlocking the reader etc.) to the parent gameobject and assign the respective variables in the inspector.
This should give you a starting point for the functionality you want.