Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

HUD key card

Prismatic Schism
Registered User
Join date: 14 Jan 2009
Posts: 7
04-10-2009 20:22
I'm building a game that uses a HUD. I want a door to open if HUD is attached and to say "access denied" if no HUD is attached. I can get the door to lock with no HUD and unlock with HUD, but I can't seem to get the door to react to no HUD.

I'm using a call and answer between door and HUD. When avatar touches door, the door calls out on a channel and listens on another channel. The HUD answers the message and the door unlocks. The problem seems to be that if the door doesn't hear any message on the listen channel, it doesn't do anything from there. Yes, it won't unlock, but I want it to say something.

Here's a snippet:

touch_start(integer number_detected)
{
key av = llDetectedKey(0);
llSay(88, "who";);
llListen(99, "", "", "";);
}

listen(integer channel, string name, key id, string message)
{
if(message == (string)av + "me";)
{
llMessageLinked(LINK_ALL_OTHERS,0,"open",llDetectedKey(0));
}
else
{
llSay(0,"access denied";);
}
}

The script never gets to the llSay function. How can I get door to respond to not just the wrong message, but NO message? Or am I on the wrong track?
Talon Brown
Slacker Punk
Join date: 17 May 2006
Posts: 352
04-10-2009 20:29
Start a timer event when the door is touched. If the HUD replies, kill the timer; otherwise it fires in x seconds and does the "access denied" stuff.
Prismatic Schism
Registered User
Join date: 14 Jan 2009
Posts: 7
thanks!
04-10-2009 20:56
Thanks very much...works perfectly! It's so often a simple solution.