Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

elevator script

Okegima Amat
Registered User
Join date: 18 Mar 2007
Posts: 138
01-09-2009 01:14
Greeting, am looking for a simple code allowing me to elevat a prim from bottom to the top.

can some one help me in writing the code.

thank you.
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
01-09-2009 07:40
there is a script currently being talked about.

however, this forum is to help others with scripts they are writing, not a free script resource, if you want someone to write a script for you, i suggest the products wanted thread
Okegima Amat
Registered User
Join date: 18 Mar 2007
Posts: 138
01-10-2009 02:56
see bellow
Okegima Amat
Registered User
Join date: 18 Mar 2007
Posts: 138
01-10-2009 17:10
well here my own script elevator. hope it could help some. it work very well with a prim and script in.

--

//Elevator version 1
//made by okgima amat.

integer targetID;
default
{
state_entry()
{
key id = llGetOwner();
llListen(0,"",id,"";);
}
listen(integer channel, string name, key id, string message)
{
if(message == "up";) //say up for start up the elevator
{
llSay(0, "Monter";);
llSleep(0.1);
llSetStatus(STATUS_PHYSICS, TRUE);
vector destination = llGetPos() + <0,0,4>; // x, y, z destination location. 4 = 4 m
targetID = llTarget(destination, 0 );
llMoveToTarget( destination, 3 ); // 3 is the speed of the elevator. over is slower
llSleep(20);
llSetStatus(STATUS_PHYSICS, FALSE);
llSay(0, "Arriver";);
llSetPos(<120,50,31>;); // reset no physical pos for a better stability when not worked. change the pos from your elevator prim x y z position.
}
if(message == "down";) //say down for start up the elevator
{
llSay(0, "Desendre";);
llSleep(0.1);
llSetStatus(STATUS_PHYSICS, TRUE);
vector destination = llGetPos() + <0,0,-4>;
targetID = llTarget( destination, 0 );
llMoveToTarget( destination, 2 );
llSleep(5);
llSetStatus(STATUS_PHYSICS, FALSE);
llSay(0, "Arriver";);
llSetPos(<120,50,27>;);
}
}
}

// hope it will help ! Good luke

--