I'm trying make a dialog where it turns on and off a light. But way I want it to work is when you click the object the dialog pops ups and says one of other like first light on then after I click it, it will switch the light on too light off. Here script I'm working on if anyone can help me out.
Thanks for help.
string light = "light off";
list main_menu = [light];
default
{
state_entry()
{
llListen(5666,"",llGetOwner(),""
;}
listen(integer channel,string name,key id,string message)
{
if(message == "light on"

{
light =(string) "light off";
llOwnerSay("test 1"
;}
if(message == "light off"

{
light =(string) "light on";
llOwnerSay("test"
;}
}
touch_start(integer total_number)
{
if(llDetectedKey(0) == llGetOwner())
{
llDialog(llDetectedKey(0),"Main Menu",main_menu, 5666);
}
}
}
string)", by the way.)
