A good way to learn scripting is by examining the stock scripts.
For instance, for this case let's look at the
dooruse.fpi in the
scriptbank paying attention to the first two lines after the ;Triggers comment...
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertouse.tga,hudname=usedoorprompt,hudhide=1,hudmake=display,state=10
:state=10,plrdistwithin=60:hudshow=usedoorprompt,hudfadeout=usedoorprompt
...As you can see, state=0 creates the HUD for future display then moves to state=10.
Then, in state=10 we check to see when the player is close with the
plrdistwithin=60 condidtion, and if so then we display the HUD with the
hudshow=usedoorprompt,hudfadeout=usedoorprompt actions.
And there you have it right in the stock scripts; an example of what you are looking to acomplish.
Good luck and don't forget to include the
desc = line in your scripts because they won't work without it.