03-04-2013, 02:04 AM
// Changes avatar hovering title on command in local chat, starting with /change. Put the script in a small box and texture the box with a 100% transparent texture. Attach the box to your upper body (head or schoulder).
Code:
// Avatar Title Changer
// author: unknown
string default_text = "Type /change to change the hovering text!";
string text;
list colors =
[<1.0,1.0,1.0>,<0.5,0.5,0.5>,<1,0,0.0,0.0>,<0.0,1.0,0.0>,<0.0,0.0,1.0>,<1.0,1.0,0.0>,
<1.0,0.0,1.0>,<0.0,1.0,1.0>];
default
{
state_entry()
{
text = default_text;
llListen(0, "", NULL_KEY, "");
llSetText(text, <0,1,0>, 1.5);
llSetTimerEvent(0.5);
}
on_rez(integer start_param)
{
text = default_text;
llSetText(text, <0,1,0>, 1.5);
}
listen(integer channel, string name, key id, string message)
{
if (llToLower(llGetSubString(message, 0, 6)) == "/change" && id == llGetOwner())
{
text = llDeleteSubString(message, 0, 6);
llSetText(text, <0,1,0>, 1.5);
}
}
timer()
{
integer random = llFloor(llFrand(llGetListLength(colors)));
llSetText(text, llList2Vector(colors,random), 1.5);
}
}