Jump to content

Help script particles on touch and stop automatically after few seconds


Novasierra
 Share

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

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

Recommended Posts

Hello scripy people:) I'm completely new to scripting, so hopefully someone can help me. I want to make a particle emitter. The idea is that someone can touch it and it emits particles for a few seconds and then it stops automatically. After that you can touch it again and it does the same thing.

I bought the particles and put it in a free script. The problem is that I can touch it and it emits the particles, but I have to touch it again to make it stop. How do I switch it to a version where the particles stop automatically after a few seconds?

I copied the script, only blurred the particle part (since it’s not for free):

///////////////////////////////////////////////

/////////////ANIMATION STATION 2011////////////

////////////////DRAKE FAUDEBURGH///////////////

///////////////////////////////////////////////

///////////////////READ THIS///////////////////

//You must click 'Running' at the bottom of the script window to activate this script!

//This is a basic Touch Toggle Script Template.

//You simply drop this script inside of your object and it will toggle the effect on and off when it is touched.

//

//Visit

//http://wiki.secondlife.com/wiki/Example_Particle_Script

//http://wiki.secondlife.com/wiki/LlParticleSystem

//for more information.....

///////////////////////////////////////////////

integer particleOn = 0;

particle()

{

llParticleSystem([

PSYS_PART_FLAGS,(0

| PSYS_PART_EMISSIVE_MASK

| PSYS_PART_BOUNCE_MASK

| PSYS_PART_INTERP_COLOR_MASK

| PSYS_PART_INTERP_SCALE_MASK

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

PSYS_SRC_ANGLE_END,0.500000*PI]);

}

stopParticle()

{

    particleOn = 0;

    llParticleSystem([]);

}

default

{

    state_entry()

    {

        particle();

    }

    on_rez(integer start_params)

    {

        particle();

    }

    touch_start(integer num_detected)

    {

        if(!particleOn)

        {

            particleOn = 1;

            particle();

        }

        else

            stopParticle();

    }

}

I searched myself, but can’t find what I’m looking for. So any help would be appreciated😊

Link to comment
Share on other sites

There are 2 methods of making a particle system only have a short duration.

  1. Use the PSYS_SRC_MAX_AGE parameter to set a duration.
    • This comes with a few odd caveats, mainly when the system is on but the duration is passed, anyone coming into range from far away might see the particles go off, and people might see the particles go off if you teleport away while wearing it or the object is modified.
  2. Set a timer to go off when the particles should turn off.
    • Fewer caveats, but mildly more complicated logic. you want to make sure to turn the timer off after it is activated, and when the particles are turned off otherwise.
  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 271 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...