Jump to content

Door Script: Rez closed


Delmar Quintessa
 Share

You are about to reply to a thread that has been inactive for 951 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

integer door = FALSE;

open ()
{
    llSetPrimitiveParams([ PRIM_SIZE, <0.010, 0.010, 1.703> ]);
}

close ()
{
    llSetPrimitiveParams([ PRIM_SIZE, <0.010, 1.761, 1.703> ]);
}

default
{
    state_entry()
    {
        close();
    }

    touch_start(integer total_number)
    {
        if(door == TRUE)
        {
            door = FALSE;
            close ();
            return;
        }
        else
        {
             door = TRUE;
             open ();
             return;
        }
    }
}

Hello-  I have this script, but would like for the door to remain closed when rezzed despite it being taken into inventory with the doors open.  I thought that's what the script was supposed to do but maybe I'm missing a line of code?  I changed Integer door to TRUE (at the very top) just to check, but it doesn't seem to make a difference.

Link to comment
Share on other sites

Add an on_Rez event and inside it either call close() or llResetScript()

 

default
{
  on_rez(integer n)
  {
    close();
  }
  state_etry....
  
}

Oh, and you don't need the two return statements in the touch event, the event isn't called as a function  so they do nothing.

Edited by Profaitchikenz Haiku
  • Like 2
Link to comment
Share on other sites

I had a more complex version of a problem similar to this on a project I worked on a few months ago. I believe in that case I had to make a separate function to 'sneakily' close the thing after it was rezzed (and also turn it invisible so you didn't see the close), bypassing a lot of fancy stuff that normally happened when the thing was closed.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 951 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...