Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Temp Rez Question

Shayna Korobase
Registered User
Join date: 8 May 2007
Posts: 454
01-14-2009 06:59
I have avery simple script that rez single objects I put in. I would like it t rez multiple objects. For example: If I have a car in it...the next item down the list will rez in 65 seconds.

Here's the script


default
{

state_entry() {
llSetTimerEvent(65);
}
timer() {

// This line will pick the first object out of the container and rez it
llRezObject(llGetInventoryName(INVENTORY_OBJECT,0), llGetPos()+<0,0,1.5>,ZERO_VECTOR,ZERO_ROTATION,0);

}

}
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
01-14-2009 11:06
Hi, this should do what you describe.

CODE


integer last_rezzed = -1; // saved contents index of the lastt object rezzed

default
{

state_entry() {
llSetTimerEvent(65.0);
}

timer() {
integer count = llGetInventoryNumber(INVENTORY_OBJECT); // how many objects in inventory?
if (count > 0) {
last_rezzed = (last_rezzed + 1) % count; // point to next object, with wraparound
llRezObject(llGetInventoryName(INVENTORY_OBJECT, last_rezzed), llGetPos()+<0,0,1.5>,ZERO_VECTOR,ZERO_ROTATION,0);
}
else {
llOwnerSay("nothing found to rez.");
llSetTimerEvent(0.0); // stop timer so we don't complain more than once
}
}
}



~Boss