Hi. I'm not a scripter. Just trying to edit and combine some codes from open sources. Basically what I'm trying to achieve is when the object is touched, a dialog will appear and when certain option / answer is clicked the Map Destination opens. I did not get any error message when I saved the script but the "llMapDestination" command is seemingly being ignored in the "if" clause. When I tried it with "llSay", it worked just fine. My scripting skills is very basic and limited to editing only so I definitely must be missing something.
* This one worked *
integer gListener;
default
{
touch_start(integer total_number)
{
llListenRemove(gListener);
key user = llDetectedKey(0);
gListener = llListen(-99, "", user, "");
llDialog(user, "\nDo you want to use the World Map?", ["Yes", "No" ] , -99);
llSetTimerEvent(60.0);
}
listen(integer chan, string name, key id, string msg)
{
if (msg == "Yes")
{
llSay(0, "It worked!");
}
llSetTimerEvent(0.1);
}
timer()
{
llListenRemove(gListener);
llSetTimerEvent(0.0);
}
}
-----------------------------------------------------
* This one didn't work, no error but world map doesn't open *
integer gListener;
default
{
touch_start(integer total_number)
{
llListenRemove(gListener);
key user = llDetectedKey(0);
gListener = llListen(-99, "", user, "");
llDialog(user, "\nDo you want to use the World Map?", ["Yes", "No" ] , -99);
llSetTimerEvent(60.0);
}
listen(integer chan, string name, key id, string msg)
{
if (msg == "Yes")
{
llMapDestination("Perlanera", <248.0, 146.0, 3694.0>, ZERO_VECTOR);
}
llSetTimerEvent(0.1);
}
timer()
{
llListenRemove(gListener);
llSetTimerEvent(0.0);
}
}