This is the gist of storing a 'key' as a flag instead of using a weapon.
Key NPC:
PHP Code:
function onPlayerTouchsMe() {
clientr.key = true; // This can be found in the script flags tab of your attributes
}
Door NPC:
PHP Code:
function onPlayerTouchsMe() {
if (clientr.key) {
hide();
sleep(3);
show();
}
}
Also 1 is the same as true in GS2.
Documentation:
clientr variable explanation
Logic and conditional statements