Quote: "Is that possible? So, that it works like a key maybe?"
YES, Just has to change this part:
if collecting == 0 then FinishLevel() end
Instead of "FinishLevel() " out your door animations.
if collecting == 0 then
your code here
end
and instead of attach the script to a barrel like I did, attach the script to your door.
Take at look for the stock doors LUA scripts, see how it does, and do the same. (door.lua) works with key, and key can to be items collected qty.
Try and improve and try, and improve and try again, learn is the key than can open many doors.
Do some copy of the script and try new ways, if you are stuck so post here your script and anyone here can help you, even me.
3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4