How do you make a script where if you click on an image, it will replace and delete the 2nd image you click?

I’m making a puzzle where if you click on a piece and click on the slot (which is an image) it will replace the slot with the image and delete the slot if it’s the correct slot, but if it’s the wrong slot, then it will say incorrect. I’m having trouble on this, and I don’t how to make the script for this.

Hello

1- Detect the first clikc

2- Activate a bool variable to know 1st click has been amde and are waiting ofr the 2nd click

3- Detect second clikc

4- Destroy the old pic and put there the newowne…

IF dont know how to do this, you should go learn step by step watching tutorials or reading manuals.

Bye!