Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

simple open/close script

Vic Clift
Registered User
Join date: 19 Feb 2007
Posts: 167
09-02-2007 16:16
Just wondered if any of you code guys could help?

I'm looking for a script that will open the lid on an object (in this case, a shell) and then automatically close it again after a few seconds. We've tried scripts from doors but too much chat...just a simple open/close will do, but I can't find one anywhere. Could anyone point me in the right direction please.

I'm only just getting to grips with building...scripting is way out of my league at the moment!! lol

Many thanks for your help :)
Lyn Mimistrobell
(waiting)
Join date: 11 Jan 2007
Posts: 179
09-03-2007 05:39
state default
{
state_entry()
{
// do whatever rotation or movement you need for your lid to close
}
touch_start(integer avatarCount)
{
// do whatever rotation or movement you need for your lid to open
state open;
}
}
state open
{
state_entry()
{
llSetTimerEvent(10.0);
}
touch_start(integer avatarCount)
{
llSetTimerEvent(0.0);
state default;
}
timer()
{
llSetTimerEvent(0.0);
state default;
}
}


I don't know what kinda shape or position your lid is in so can't give you code for that. But this should be a good start for you.
Vic Clift
Registered User
Join date: 19 Feb 2007
Posts: 167
09-03-2007 10:31
Thank you for taking the time to reply Lyn...I will work on this :)