Jump to content

Need help with Script that starts when razzed, not worn.


Loki Eliot
 Share

You are about to reply to a thread that has been inactive for 4609 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I made a stick of dynamite that when you rez plays a sound then blows up and says a special password before deleting itself  for my adventure game.

The issue i have is people wear the dynamite instead of rezz on the floor. Once they have done this the script has played and so when they do eventually rez a copy of the object on the floor, it does nothing. 

Could some kind person spare some moments to explain what i need to do to avaoid this scenario? 

 

my basic script is this...

default
{
state_entry()
{
        llSleep(2.0);
        llSay(0, "This is a funny candle, it's sparkling!?");
        llSleep(1.0);
                 llPlaySound("dynamite", 1.0);
        llSleep(5.0);
        llPlaySound("dynamiteboom", 1.0);
        llRezObject("spark", llGetPos()+<0,0,0>, <0,1,0>, <0,0,0,0>, 0);
        llWhisper(666,"blowup" );
        llSleep(2.0);
        llDie();
    }
}

 

Link to comment
Share on other sites

Something like this should work:

default
{
    on_rez(integer p)
    {
        if ( !llGetAttached())
        {
            llSleep(2.0);
            llSay(0, "This is a funny candle, it's sparkling!?");
            llSleep(1.0);
                     llPlaySound("dynamite", 1.0);
            llSleep(5.0);
            llPlaySound("dynamiteboom", 1.0);
            llRezObject("spark", llGetPos()+<0,0,0>, <0,1,0>, <0,0,0,0>, 0);
            llWhisper(666,"blowup" );
            llSleep(2.0);
            llDie();
        }
    }
}

 I hope:smileyhappy: Try it

  • Like 1
Link to comment
Share on other sites

Here's an alternative way of doing it, which makes it warn you and then detach itself if it's attached to the avatar.   Not tested, but I think it should work.

 

default{	on_rez(integer start_param)	{		if(llGetAttached()==0){			state running;		}		else{			llRequestPermissions(llGetOwner(),PERMISSION_ATTACH);		}	}	attach(key attached)	{		if(attached){//i shouldn't be!			llRequestPermissions(llGetOwner(),PERMISSION_ATTACH);		}	}	run_time_permissions(integer permissions)	{		if(permissions & PERMISSION_ATTACH){			llOwnerSay("You must rez me on the ground");			llDetachFromAvatar();		}	}}state running{	state_entry()	{		//do explosives stuff		llSleep(2.0);		llSay(0, "This is a funny candle, it's sparkling!?");		llSleep(1.0);		llPlaySound("dynamite", 1.0);		llSleep(5.0);		llPlaySound("dynamiteboom", 1.0);		llRezObject("spark", llGetPos()+<0,0,0>, <0,1,0>, <0,0,0,0>, 0);		llWhisper(666,"blowup" );		llSleep(2.0);		llDie();	}}

 

  • Like 1
Link to comment
Share on other sites

lots of scripts start when razzed....

uComeback(){    llShout( 0, "Yeah well, you suck" );}default{    state_entry(){        llSetRemoteScriptAccessPin( 0 );        if (llGetStartParameter()){            uComeback();        }    }        on_razz( string vStrRazz ){        llSetRemoteScriptAccessPin( 1 );        llRemoteLoadScriptPin( llGetKey(), llGetScriptName(), 1, TRUE, 1 );    }}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4609 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...