Jump to content

Curtan - like Door, but needs a lock?


Victoria Lovelace
 Share

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

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

Recommended Posts

Hello everyone.

 

I have made a door with a script that makes it lift upwards, like the motion of a curtain. Think of it like a garage door that folds... lol. So the door is already scripted to move up and down this way. But I cannot find out how or find an already made script to add to my already existing script for LOCKing the door. Right now, anyone can open it. I would like to have a whitelist.

 

Here is the script that is currently in the door:

vector offset = <0,0,1>; //Prim moves/changes size along this local coordinate
float hi_end_fixed = FALSE; //Which end of the prim should remain in place when size changes?          
                            //The one with the higher (local) coordinate? 
float min = 0.2; //The minimum size of the prim relative to its maximum size
integer ns = 5; //Number of distinct steps for move/size change
 
 
default {
    state_entry() {
        offset *= ((1.0 - min) / ns) * (offset * llGetScale());
        hi_end_fixed -= 0.5;
    }
 
    touch_start(integer detected) {
        integer i;
        do  llSetPrimitiveParams([PRIM_SIZE, llGetScale() - offset,
                PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]);
        while ((++i) < ns);           
        offset = - offset;
    }
}

 Found from here: http://wiki.secondlife.com/wiki/Curtain_script

 

So is there a way to add a lock to this script? I have tried adding onto the script for making it lockable but all i get is errors. I have tried making a whole new script but it doesnt seem to work. any suggestions would be greatful. please know that I am not that great at scripting though.

 

Link to comment
Share on other sites

As Darkie kindly points out, my Generic Whitelist script ought to point you in the right direction.  You should understand, however, that a locked door (or curtain) in SL is just aesthetic.  It doesn't really keep people out.  At best, it's a two second annoyance, since anyone can get to the other side by simply sitting on something there (and of course can always cam in).

  • Like 1
Link to comment
Share on other sites

thanks ill try it out. i need the lock not really to keep people out, but to keep my pet inside lol. if anyone strolls up and leaves the door open my pet can get out xD although it is set on a range, it can still wander out a little bit. the house was designed to be opened, i put up my own walls and door onto it to make it more closed in.

 

i suppose making it auto close could work too, but i also dont know how to do that lol.

Link to comment
Share on other sites

Hehe... That's easier than creating a whitelist.  When you open the curtain, start a timer.  Then, copy the entire block of code from your touch_start event into a new timer event and add a llSetTimerEvent(0.0) statement to shut off the timer when the curtain is closed again.  Unless you do a tiny bit of extra scripting, you'll have to be careful not to touch the curtain again until the timer is finished, but that little addition will at least give you an autoclose feature.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4255 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...