When the pole is touched, the user is presented with a menu via llDialog. The Agent Key belonging to the avitar who touched the pole is passed correctly to llDialog. When the Listen event occurs, I seem to be getting the wrong Agent key passed. This results in the wrong avitar being affected by the llDialog command.
Help!!!
Thanks in Advance
OwenJ
Code Sample follows.
///////////// GLOBAL VARIABLES ///////////////
list ANIMATIONS;
list AGENTS;
list LISTENHANDLES;
list PERMISSIONS;
integer gAnimNumber;
integer gTotalAnims;
string gAnimName = "type";
integer permissionResult = FALSE;
integer debugMode = TRUE;
integer chatChannel = -10;
/////////// END GLOBAL VARIABLES /////////////
touch_start(integer num_detected) {
integer touchedIndex;
for (touchedIndex = 0; touchedIndex < num_detected; touchedIndex++) {
key agent = llDetectedKey(touchedIndex);
if (agent != NULL_KEY) {
integer agentIndex = llListFindList(AGENTS, (list) agent);
integer permissionsResult = FALSE;
if (agentIndex != -1) {
permissionsResult = llList2Integer(PERMISSIONS, agentIndex);
}
if ( agentIndex == -1 || permissionsResult == FALSE) {
AGENTS += [ agent ];
PERMISSIONS += [ FALSE ];
LISTENHANDLES += [ 0 ];
llRequestPermissions(agent, PERMISSION_TRIGGER_ANIMATION);
}
else {
llDialog(agent, "Dance Options", ANIMATIONS, chatChannel);
}
}
}
}
listen( integer channel, string name, key agent, string message ) {
integer agentIndex = llListFindList(AGENTS, (list) agent);
integer listenHandle = llList2Integer(LISTENHANDLES, agentIndex);
if (agentIndex != -1) {
if (message == "Stop"
{llRequestPermissions(agent, FALSE);
if (gAnimName != ""

llStopAnimation(gAnimName);
llListenRemove(listenHandle);
AGENTS = llDeleteSubList(AGENTS, agentIndex, agentIndex);
PERMISSIONS = llDeleteSubList(PERMISSIONS, agentIndex, agentIndex);
LISTENHANDLES = llDeleteSubList(LISTENHANDLES, agentIndex, agentIndex);
}
else {
if (~llListFindList(ANIMATIONS, (list) message)) {
if (gAnimName != ""

llStopAnimation(gAnimName);
llStartAnimation( message );
if (debugMode == TRUE)
llOwnerSay("Animation: " + message);
gAnimName = message;
}
}
}
}