Particle Poofer Script

Written by: Headmaster

Add script and a single texture to a prim. use the following commands to configure the poofer script: Say: set keyword - sets the keyword which activates the poofer (the scripts default keyword is 'poof') example say: set keyword pop would cause the poofer script to trigger whenever you say 'pop' set channel - sets the chat channel the poofer listens on example set channel 12 will instruct the poofer script to listen for the keyword on channel 12 (so to activate it you would type '/12 poof')

 

string    texture;
string    keyword = "poof";


updateParticles()
{
    llParticleSystem([0,256,1,<1.0,1.0,1.0>,2,1.0,5,<1,1,1>,7,8.0,9,2,12,texture,13,0.1,15,12,17,0.5,18,0.5,19,2.0]);
    llSleep(2.5);
    llParticleSystem([]);
}

integer channel = 0;

integer Handle;
default
{
    state_entry() {
        texture = llGetInventoryName(INVENTORY_TEXTURE, 0);
        Handle = llListen (channel, "", llGetOwner(), "");
    }
    changed(integer change)
    {
        if (change & CHANGED_OWNER)
            llResetScript();
    }

    listen(integer chan, string name, key id, string msg) 
    {
        if (msg == keyword) {
            updateParticles();
        } else if (llToLower(llGetSubString(msg, 0, 10)) == "set keyword") 
        {
            keyword = llToLower(llDeleteSubString(msg, 0, 11));
            llOwnerSay("Keyword set to "+keyword);
        } else if (llToLower(llGetSubString(msg, 0, 10)) == "set channel") 
        {
            if ((channel = ((integer)llDeleteSubString(msg, 0, 11))) < 0) channel = 0;
            llOwnerSay("Chat Channel set to "+(string)channel);
            llListenRemove(Handle);
            Handle = llListen (channel, "", llGetOwner(), "");
        }
    }
}