and has physics on to cause damage on land with damage on.
Cannot figure why this simple code here doesn't do what I need
after it rezzes when I shoot... any of you the most experienced
know why? It does spin fast in SL though, but nothing in opensim
when rezzed with physics on and set temp, includes code so it
deletes itself .. now for shooting I need the atached prim to
disappear instantly after shoot for temp time, transparent
alpha then it reapears back... any pointers on other code that
does that already or maybe some help in fixing this up..
Code: Select all
//spin the prim
default
{
state_entry()
{
llTargetOmega(<0,1,0>,6,6);
llSetBuoyancy(1.0);
}
}
}
///////////////////
Code: Select all
//shoot the projectile base code
vector fwd;
vector pos;
rotation rot;
float power = 100.0;
key holder;
vector centerpos;
integer attached = FALSE;
integer permissions = FALSE;
fire_ball()
{
rot = llGetRot();
fwd = llRot2Fwd(rot);
pos = llGetPos();
pos = pos + fwd;
pos.z += 0.75;
fwd = fwd * 10.0;
llRezObject("axe", pos, fwd, rot, 1);
llStartAnimation("throw_r");
llPlaySound("axe 2",1.0); //
}
default
{
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION| PERMISSION_TAKE_CONTROLS | PERMISSION_ATTACH);
}
on_rez(integer param)
{
llResetScript();
}
run_time_permissions(integer permissions)
{
if (permissions > 0)
{
if (!attached)
{
llAttachToAvatar(ATTACH_RHAND);
}
llTakeControls(CONTROL_ML_LBUTTON, TRUE, FALSE);
attached = TRUE;
permissions = TRUE;
}
}
attach(key attachedAgent)
{
if (attachedAgent != NULL_KEY)
{
attached = TRUE;
if (!permissions)
{
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION| PERMISSION_TAKE_CONTROLS | PERMISSION_ATTACH);
}
}
else
{
attached = FALSE;
llReleaseControls();
}
}
control(key name, integer levels, integer edges)
{
if ( ((edges & CONTROL_ML_LBUTTON) == CONTROL_ML_LBUTTON)
&&((levels & CONTROL_ML_LBUTTON) == CONTROL_ML_LBUTTON) )
{
{
fire_ball();
}
}
}
}