For example, if you've animate door open with a key, so you place door and key on map, click over the door>properties, there go to "Main" mouse click and search there for "door.lua" script. Click OK.
Then you are done. Test your game, collect key, open the door.
Sames in all cases, just attach your script to entity, via poperties panel>Main
3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics