I want to make a "heart bomb" that when you throw it, it rezez a smaller heart that is set up on a timer to "explode" and rezzes out other tiny prim hearts.
I have all that set and working OK.
But now I'm' stumped and Id like to add a menu so by clicking the heart you hold in your hand, the menu will give you options for setting the timer from 5sec - 10sec - 20sec for the rezzed heart that "explodes".
Where and how do i add a Menu for this?
Thanks for any help!
~ B
--------------------------
The Heart exploder/rezzer -
------------------------
default
{
state_entry() {
llSetTimerEvent(10.0);
}
timer() {
llMakeExplosion(20, 9.0, 2, 15.0, 1.0, "Red smoke", ZERO_VECTOR);
llPlaySound("I love you",5.0);
llRezObject("small heart", llGetPos() + <-5.0,0.0,0.0>, <0.0,0.0,0.0>, <0.0,0.0,0.0,0.0>, 0);
llRezObject("small heart", llGetPos() + <0.0,3.0,0.0>, <0.0,0.0,0.0>, <0.0,-7.0,0.0,0.0>, 0);
llDie();
}
}
---------------------------
And the throw script I'm using
---------------------------
integer have_permissions = FALSE;
fire()
{
rotation rot = llGetRot();
vector vel = llRot2Fwd(rot);
vector pos = llGetPos();
pos = pos + vel;
pos.z += 0.75;
vel = vel * 15;
llStartAnimation("throw_r"
;llSleep(1);
llRezObject("Big Heart", pos, vel, rot, 0);
llSetTimerEvent(5);
}
default
{
state_entry()
{
key owner = llGetOwner();
llListen(8,"",owner,"r"
;if (!have_permissions)
{
llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION| PERMISSION_TAKE_CONTROLS);
}
}
listen(integer channel, string name, key id, string message)
{
llResetScript();
}
on_rez(integer param)
{
}
run_time_permissions(integer permissions)
{
if (permissions == PERMISSION_TRIGGER_ANIMATION| PERMISSION_TAKE_CONTROLS)
{
llTakeControls(CONTROL_ML_LBUTTON, TRUE, FALSE);
have_permissions = TRUE;
}
}
attach(key attachedAgent)
{
if (attachedAgent != NULL_KEY)
{
llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION| PERMISSION_TAKE_CONTROLS);
}
else
{
if (have_permissions)
{
llStopAnimation("hold_R_rifle"
;llStopAnimation("aim_R_rifle"
;llStopAnimation("hold_R_handgun"
;llStopAnimation("aim_R_handgun"
;llReleaseControls();
llSetRot(<180,0,0,8>
;have_permissions = FALSE;
}
}
}
control(key name, integer levels, integer edges)
{
if ( ((edges & CONTROL_ML_LBUTTON) == CONTROL_ML_LBUTTON) &&
(levels & CONTROL_ML_LBUTTON) == CONTROL_ML_LBUTTON) ){
fire();
}
}
touch_end(integer num)
{
if (have_permissions)
{
;
}
else
{
llWhisper(0, "wear me"
;}
}
timer()
{
llShout(5,"heart"
;}
}

