one object?
like for example: lets say i want prim A(root prim) to hold a changing
color script but i dont want prim A to change color, i want to be able to
change the color of prim B and C which will both have the name "color"
is there a way for me to get this script to only change the color of any
prim with a name(like "color" for example) that is linked to the root prim?
integer lHandle = -1;
integer run = 1;
vector Color = <0,1,1>;
vector string2vector(string s)
{
list foo = llCSV2List(s);
vector v;
v.x = llList2Float(foo,0);
v.y = llList2Float(foo,1);
v.z = llList2Float(foo,2);
return v;
}
float fixColor(integer c)
{
if (c > 255) return 255;
if (c <= 0) return 0;
return (float)c/255;
}
vector colorVector(string s)
{
list foo = llCSV2List(s);
vector v;
v.x = fixColor(llList2Integer(foo,0));
v.y = fixColor(llList2Integer(foo,1));
v.z = fixColor(llList2Integer(foo,2));
//llWhisper(0, "Debug: v: " + (string)v);
return v;
}
default
{
state_entry()
{
llListenRemove(0);
if (lHandle == -1) lHandle = llListen(0, "", llGetOwner(), ""
;}
on_rez(integer peram)
{
llResetScript();
}
listen(integer channel, string name, key id, string msg)
{
list argv = llParseString2List(msg, [" "], []);
integer argc = llGetListLength(argv);
string cmd = llToLower(llList2String(argv, 0));
//this is where you can change the command to any thing else //(like the parts name for example)
if (cmd == "gripcolor" | cmd == "guncolor"

{
Color = colorVector(llList2String(argv, 1));
llSetColor((Color), ALL_SIDES);
}
}
}
thanks in advance.
