Various Prim effects stay even after scripts are removed -- this provides a way to remove prim-remembered FX. Drop this script into the affected prim, then touch it.
Code:
// Just drop this script into a scriptless prim that has lingering effets you don't want, "Touch" it to brng up the menu.
list buttons =["SitTarget", "FloatText", "Particles","TextureAn", "Sound", "TargetOmega", "ALL", "DESTRUCT"];
string menutext = " \nSitTarget : Clears Sit Position\nFloatText : Clears Floating Text\nParticles : Clears Particle Generation\nTextureAn : Clears Texture Animation\nTargetOmega: clears llTargetOmega()\nALL : Clears all of the above\nDESTRUCT : Removes script from prim";
integer handler;
default
{
state_entry()
{
if (handler)
{
llListenRemove(handler);
}
handler =llListen(1,"",llGetOwner(),"");
}
touch_start(integer num_detected)
{
llDialog(llGetOwner(), menutext, buttons, 1);
}
listen( integer channel, string name, key id, string message )
{
string lowmsg = llToLower(message);
if (lowmsg == "sittarget")
{
llWhisper(0,"Clearing Sit Position.");
llSitTarget(ZERO_VECTOR,ZERO_ROTATION);
}
if (lowmsg == "floattext")
{
llWhisper(0,"Clearing Floating Text.");
llSetText("", <1,1,1>, 0.0);
}
if (lowmsg == "particles")
{
llWhisper(0,"Clearing Particles.");
llParticleSystem([]);
}
if (lowmsg == "texturean")
{
llWhisper(0,"Clearing Texture Animation.");
llSetTextureAnim(FALSE, ALL_SIDES,0,0,0.0, 1,0.0);
}
if(lowmsg == "targetomega")
{
llWhisper(0, "Clearing llTargetOmega().");
llTargetOmega(ZERO_VECTOR, 0.0, 1.0);
}
if(lowmsg == "sound")
{
llWhisper(0, "Clearing Sounds.");
llStopSound();
}
if (lowmsg == "all")
{
llWhisper(0,"Clearing Floating Text.");
llSetText("", <1,1,1>, 0.0);
llWhisper(0,"Clearing Texture Animation.");
llSetTextureAnim(FALSE, ALL_SIDES,0,0,0.0, 1,0.0);
llWhisper(0,"Clearing Particles.");
llParticleSystem([]);
llWhisper(0,"Clearing Sit Position.");
llSitTarget(ZERO_VECTOR,ZERO_ROTATION);
llWhisper(0, "Clearing llTargetOmega().");
llTargetOmega(ZERO_VECTOR, 0.0, 1.0);
llStopSound();
}
if (lowmsg == "destruct")
{
llWhisper(0,"Removing script from prim in 0.2 seconds");
llSleep(0.2);
llRemoveInventory(llGetScriptName());
}
}
}