My problem comes in the listen or the timer if statement.
When I click on "Random" from he llDialog, it recognizes it in the listen, but does nothing in the timer (if I put a llSay() in the listen it sets it off). I click on something else in the menu, and it works like it should (setting off the "else" statement) saying "!".
The script will not say "." or do the commands it's programmed to.
Switch is of the correct number.
Any Ideas on problems? I even changed the if statement in the timer to reflect something totally different, but it still failed to fire.
CODE
list men = ["5","Random","Off",".7","1","2",".1",".2",".5",".05"];
integer rr ;
float st;
list master = [b01,b1,b2,b3,b4,c1,c2,c3,c4,g1,g2,g3,g4,o1,o2,o3,o4,r1,r2,r3,r4,w1,w2,w3,w4,y1,y2,y3,y4];
// ----
integer switch;
default
{
on_rez(integer x)
{
llResetScript();
}
state_entry()
{
rr = (integer) llFrand(10000000) - 5000000;
switch = 1;
st = 0;
llSetTimerEvent(st);
llListenRemove(llListen(rr,"",NULL_KEY,"") );
llListen(rr,"",NULL_KEY,"");
llSetTexture(b01,1);
}
touch_start(integer total_number)
{
if (llDetectedKey(0) == llGetOwner() )
{
llDialog(llDetectedKey(0),"What would you like?",men,rr);
}
}
listen(integer chan,string name,key id, string mess)
{
if (mess == "Random")
{
switch = 2;
llSetTimerEvent(.5);
}
if (mess == "Off")
{
llResetScript();
}
else
{
switch = 1;
st = (float) mess;
llSetTimerEvent(st);
}
}
timer()
{
if (switch == 2)
{
llSay(0,".");
integer dd = (integer) llFrand(29) + 1;
llSetTexture(llList2Key(master,dd),1 );
}
else
{
llSay(0,"!");
}
}
}