Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rez copy of lost object

Dovic Battery
Registered User
Join date: 28 Aug 2006
Posts: 6
08-03-2008 00:13
Hi Folks :)

i'm no scripter, but i have managed to edit some to do what i wanted, more by luck than anything else.. my problem right now is i want to put a small build inside a box that will rez the moment it's put down.. then also if the rezzed build should vanish for any reason i want the rezzer to rez a copy of the build in the same location. I hope this makes sense to you ..
this is what i have so far... it's not my script but a free one i picked up along the way :)

thanks in advance, Dovic Battery


integer rezzed = 0;

default
{
state_entry()
{

}

on_rez(integer total_number)
{
if(!rezzed){
llRezObject("object",llGetPos()+<5,0,3>,ZERO_VECTOR,ZERO_ROTATION,42);
rezzed = TRUE;
}else{
llSay(154,"unrez!";);
rezzed = FALSE;

}
}
}
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
08-03-2008 06:43
Hmmm... To me, rezzing without first choosing where you will rez seems like a flaw in design so I'll make the script rez for the first only after you click it.

key RezKey;

default
{
on_rez(integer param) { llResetScript(); }

state_entry()
{
llSetTimerEvent(0.0);
}

touch_start(integer total)
{
if (llDetectedKey(0) == llGetOwner()) // Obey only to owner
{
llSay(154,"unrez!";); // Clear the space?
llRezObject("object", llGetPos() + <5.0, 0.0, 3.0>, ZERO_VECTOR, ZERO_ROTATION, 42);
}
}

object_rez(key id)
{
RezKey = id; // The key of what we just rezzed
llSetTimerEvent(30.0);
}

timer()
{
if (llList2Vector(llGetObjectDetails(RezKey, [OBJECT_POS]), 0) == ZERO_VECTOR)
{
// Object is gone
llSetTimerEvent(0.0);
llRezObject("object", llGetPos() + <5.0, 0.0, 3.0>, ZERO_VECTOR, ZERO_ROTATION, 42);
}
}
}

That's it.
Dovic Battery
Registered User
Join date: 28 Aug 2006
Posts: 6
08-03-2008 08:31
Kaluura Boa , thank you so much... this was my first post on this forum for help and your script did everything i wanted it too, as soon as the build vanished it rezzed a copy.

i wish you a very nice day and if there is anything i can do for you in return let me know..feel free to look around the 3Amigos island and if there is anything you would like.. I'M me and it's yours :).. thanks again..

Dovic.