Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script opengrid - Door with password
#1
Lightbulb 
Adapted for opensim

open door
say chat local /66 password


Code:
vector closed = <2,-0.5,0>;
integer open = FALSE;
string password = "password";
integer chann = 66;
integer listener = TRUE;
default
{
    touch_start(integer num_detected)
    {
        if (open == FALSE)
        {
            llInstantMessage(llDetectedKey(0) , "Say Password in channel " + chann);
            llListen(chann, "","","");
            listener = TRUE;
            llSetTimerEvent(15.0);
        }
        else if (open == TRUE)
        {
            llSetPos(llGetPos() - closed);
            open = FALSE;
            llListenRemove(1);
            listener = FALSE;
        }
    }
    listen(integer channel, string name, key id, string message)
    {
        if (open == FALSE)
        {
            if (llToLower(message) == password)
            {
                llSetPos(llGetPos() + closed);
                open = TRUE;
                llListenRemove(1);
                listener = FALSE;
            }
            else if (llToLower(message) != password)
            {
                llWhisper(0, "Invalid password");
                llListenRemove(1);
                listener = FALSE;
            }
        }
    }
    timer()
    {
        if (listener == TRUE)
        {
            llListenRemove(1);
            llWhisper(0, "Timeout.");
            listener = FALSE;
            llSetTimerEvent(0.0);
        }
        else if (listener == FALSE)
        {
            llSetTimerEvent(0.0);
        }
    }
}
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  script Opengrid - avatar key and name speaker trainz 1 691 12-14-2011, 05:21 AM
Last Post: Anarchist_Labs
Photo Script Opensim - Texture Carte Map trainz 1 682 12-14-2011, 05:18 AM
Last Post: Anarchist_Labs
Star Script OPENGRID - Paticle Fire Orange trainz 1 907 11-12-2011, 04:04 AM
Last Post: LordJames
  Script Opensim - Texture UUID trainz 0 639 11-05-2011, 08:59 PM
Last Post: trainz
Brick Script opengrid - sim info trainz 0 589 11-05-2011, 08:31 PM
Last Post: trainz
Lightbulb Script Opensim - Door Rot90° trainz 0 587 11-05-2011, 08:26 PM
Last Post: trainz
Bug script opengrid - Land info script trainz 0 566 11-05-2011, 07:54 PM
Last Post: trainz
  Script Opengrid - Group inviter trainz 0 616 11-05-2011, 07:41 PM
Last Post: trainz
Music Script Opengrid - Parcel Audio System trainz 0 449 11-05-2011, 07:30 PM
Last Post: trainz
Rainbow Script Opengrid - Teleport collision trainz 0 455 11-05-2011, 12:44 PM
Last Post: trainz



Users browsing this thread: 1 Guest(s)