This is the sort of thing I find myself doing a lot, especially with people as you want them to say different things if the player talks to them multiple time.
The more "code friendly" approach is to create an integer attribute on the door (Attributes tab); I always call it "state" and have it start at zero (which it will default to).
Then in your "knock on" script (i.e., the command or verb), you check the value of "state", and increment it. You could do that with a Switch command or a series of if else.
switch (this.state) {
case (0) {
msg ("You knock the first time.")
}
case (1) {
msg ("You knock again.")
}
case (2) {
msg ("Third time lucky, right?")
}
default {
msg ("Is there really any point in doing it again?")
}
}
this.state = this.state + 1
Using if/else might be easier if you do not like code view because of the way switch gets displayed.
if (this.state = 0) {
msg ("You knock the first time.")
}
else if (this.state = 1) {
msg ("You knock again.")
}
else if (this.state = 2) {
msg ("Third time lucky, right?")
}
else {
msg ("Is there really any point in doing it again?")
}
this.state = this.state + 1
Either way make sure you have a catchall at the end for when the player does it a hundred times.
By the way, I am using "this" as the object name. In case you do not know, "this" is a special word in Quest and refers to the object to which the script is attached, so the above will work with a verb, no matter what the object is called. If you are doing this as a command (and if you do not know what I am talking about, you probably are), just replace each "this" with the name of your door object (you can learn about verbs
here if you are interested).