I'm kinda new to scripting and this has been giving me a head ache, I have two cubes that I want when you click, to talk to one another. You click your opponent's cube and it starts a duel, your opponent in turn must click your cube. Once you click a cube both of them talk to one another transfering "stats" back and forth. Once it does this, it should prompt each contestant if they want to duel with a dialog, if you click yes your cube tells the other one its ready, and vice versa here is a chunk of the beginning of the script, please help.
Have had problems where one person can click on the other's cube but the second person can't click on mine. is this a scripting issue or an issue with LSL that I'm not aware of.
CODE
//Dueling Script for the Legend of the Five Rings Sim
//GLOBAL VARIABLES
//Global variables of my Air, Earth, Fire, Water, Void, Iaj Stat, or list containing all stats
list mystats = [];
//Global variables of my opponents Voic, Fire, Air, Iaj stat or like above list
list opstats = [];
//lldialog button list for duel permission
list DUEL = [ "Yes", "No" ];
//lldialog button list for concede dialog
list CONCEDE = [ "Concede", "Continue" ];
//lldialog button list for focus dialog
list FOCUS = [ "Focus", "Strike" ];
//listen switch
integer listenswitch;
// Focus Target Number Global
integer focusTN = 5;
//name to varify dueler
string opname;
//if opponent strikes, you will get a TRUE value and strike
integer strikewinner;
//tie breaking numbers in case of ties
integer tieBreakerNumYou;
integer tieBreakerNumOp;
default
{
state_entry()
{
//get descript for stats, and put it in list
string tempstat = llGetObjectDesc();
mystats = llKey2Name(llGetOwner())+llCSV2List(tempstat);
//listen function
listenswitch = llListen( 421, "", NULL_KEY, "" );
//TEMPORARY llsays to see if script worked
llSay(0, (string)mystats);
llSay(0, (string)llGetListLength(mystats));
}
touch_start(integer total_number)
{
string statsmessage = llList2CSV(mystats);
opname = llKey2Name(llDetectedKey(0));
//Enables Listen
llListenControl(listenswitch, TRUE);
//TEMPORARY testing say
llSay(0, statsmessage);
llSay(421, statsmessage);
//animation permission as well as camera angle permission
}
listen( integer channel, string name, key id, string message )
{
if(channel == 421)
{
//listens for list then converts it to a global list for stats
string tempstat = message;
opstats = llCSV2List(tempstat);
//TEMPORARY llsays to see if script worked
llSay(0, (string)opstats);
llSay(0, (string)llGetListLength(opstats));
state question;
}
}
}
state question
{
state_entry()
{
llListenControl(listenswitch, TRUE);
//dialog asking if you want to duel or not
llDialog(llDetectedKey(0), "Do you wish to duel " + (string)llKey2Name(llGetOwner()) + "?", DUEL, 421);
llOwnerSay(opname + " wishes to duel you, if you wish to duel them, click on their katana if you haven't already done so.");
}
listen( integer channel, string name, key id, string message )
{
if (llListFindList(DUEL, [message]));
{
if(message == "Yes")
{
llOwnerSay(opname + " has said Yes to the duel.");
llSleep(10);
llSay(421, "DUEL");
}
if(message == "No");
{
llOwnerSay(opname + " has said No to the duel.");
llResetScript();
}
}
if(message == "DUEL")
{
//call dueling animation, NOT IN PLACE YET
state stance;
}
}
}