Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

LLDIE for a rez object script

Mephistopheles Wingtips
Registered User
Join date: 17 Oct 2007
Posts: 10
02-13-2008 10:47
hello everyone,
im writing a script that will rez an object containing a particle script, that basically creates a splatter of blood when the object containing the script collides with an avatar. So far so good, the object rezzes fine when my av collides with it. However the rez script wont let me kill the rezzed object. it just loops it forever. ive included a set timer event and die commands, but it still loops. need some help sorting this bit out please. I want the rez object to die after 0.5 secs and only rez again upon another collision. any help appreciated thnx.


//Meph’s stupid problematic Blood rezzing script

vector velocity;
integer shot = FALSE;
integer fade = FALSE;
float alpha = 1.0;

default
{
state_entry()
{
llSetStatus(STATUS_DIE_AT_EDGE, TRUE);
}

on_rez(integer start_param)
{
llSetStatus(STATUS_DIE_AT_EDGE, TRUE);
llSetBuoyancy(1.0);
llCollisionSound("", 1.0); // Disable collision sounds
velocity = llGetVel();
float vmag;
vmag = llVecMag(velocity);
if (vmag > 0.1) shot = TRUE;
llSetTimerEvent(0.5);
}

collision_start(integer num)
{
if (llDetectedType(0) & AGENT)
{
// llTriggerSound("frozen", 1.0);
llRezObject("Blood splatter", llDetectedPos(0), ZERO_VECTOR, llGetRot(), 0);
{
integer i;
for ( i=0; i<num; i++ ) {

llRezObject( "Blood splatter", llGetPos()+<0,0,1>, <0,0,0>, <0,0,0,1>, i );
integer i;
}}
}
}

timer() // problem begins here i think, doesnt want to die after 0.5 secs no matter how much i yell at it.
{
if (!fade)
{
if (shot)
{
llDie();
}
}
else
{
llSetAlpha(alpha, -1);
alpha = alpha * 0.95;
if (alpha < 0.1)
{
llDie();
}
}
}
}


It would really help me if you could copy and paster your solution in a reply so i can esily slip it into my script. thnx again
Destiny Niles
Registered User
Join date: 23 Aug 2006
Posts: 949
02-13-2008 10:55
You cannot delete another object. The die script have to be in the "Blood splatter".
A particple script to create a blood splatter may be more useful.
Mephistopheles Wingtips
Registered User
Join date: 17 Oct 2007
Posts: 10
02-13-2008 12:49
thnx. so ill make the blood splatter object invis and get the blood splatter particles to die after 0.5 secs. thnx