Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Changing color, an action, then reverting to starting color

Johnny Night
Registered User
Join date: 18 Apr 2005
Posts: 33
04-27-2005 20:02
Lets say I have a prim. I have it set so that when I say "prim" it changes color and makes a sound. How can I get it to go back to the original color after it is finished playing the sound? I have it set so that it chages color and makes the sound. Just need to know how to put it back when it's done.
Brian Mifflin
Scripting Addict
Join date: 15 Dec 2004
Posts: 182
04-27-2005 20:42
I'd say save the color in a vector

vector vPrevColor = llGetColor(0);
llSetColor(vNewColor, ALL_SIDES);

then play the sound and sleep for the duration of the sound (you have to hardcode this)

llSleep(1.2); or llSetTimerEvent(1.2);

llSetColor(vPrevColor, ALL_SIDES);

-or-

timer() {
llSetColor(vPrevColor, ALL_SIDES);
}
_____________________
Johnny Night
Registered User
Join date: 18 Apr 2005
Posts: 33
04-27-2005 22:48
That worked great thanks!