This is for giving the key to the player you want.
NPC Code:
if (#a=Lugie && strequals(#c,give key #a)) {
message The Player #a now gots a key.;
set gotkey;
sleep 2;
message;
}
This is for unseting the key off the player.
NPC Code:
if (#a=Lugie&&strequals(#c,Take key #a)) {
message The Player #a's key was tooken.;
unset gotkey;
sleep 2;
message;
}