Hi im very new to scripting but making progress (ive managed a few simple things) now im trying to make a on/off script for a crystal lamp ive made, its 3 diff meshes linked, stand is the root and the two others are the floating crystals and the main crystal. the script ive managed turns the linked prims glow and full bright on or off on touch, thats all working, i also wanted it to turn on/off a emits light on the main crystal but i wanted it to change the color of that to correspond with whatever the main top crystal is tinted too without having to change this in a script, so read the tint that the crystal is and then set the emits light color to the same, ive run into alot of hurdles but cannot seem to overcome this part on my own, please offer help and also any advice to making this better,
integer switch;
default
{
state_entry()
{
list primcolor = llGetLinkPrimitiveParams (2, [PRIM_COLOR, 1]);
vector colorpick = llList2Vector (primcolor, 0);
}
touch_start(integer total_number)
{
if (switch==0)
{
switch=1;
llOwnerSay ("lamp on");
llSetLinkPrimitiveParams (LINK_ALL_OTHERS, [PRIM_FULLBRIGHT, ALL_SIDES, TRUE]);
llSetLinkPrimitiveParams (2, [PRIM_GLOW, ALL_SIDES, 0.10]);
llSetLinkPrimitiveParams (3, [PRIM_GLOW, ALL_SIDES, 0.05]);
llSetLinkPrimitiveParams (2, [PRIM_POINT_LIGHT, TRUE, colorpick, 1.0, 3.0, 0.0]); // this is where its saying error name not within scope with the colorpick part
}
else if (switch==1)
{
switch=0;
llOwnerSay ("lamp off");
llGetLinkPrimitiveParams (1, [PRIM_COLOR, ALL_SIDES]);
llSetLinkPrimitiveParams (LINK_ALL_OTHERS, [PRIM_FULLBRIGHT, ALL_SIDES, FALSE]);
llSetLinkPrimitiveParams (LINK_ALL_OTHERS, [PRIM_GLOW, ALL_SIDES, 0.0]);
llSetLinkPrimitiveParams (2, [PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR, 1.0, 3.0, 0.0]);
}
}
} https://prnt.sc/20mva0v