------------------Map Destination-----------------
default {
state_entry()
{
llSetText( "Teleport to Cirque du Self-Access",<1 1="">, 1 ); 1>
}
touch_start(integer total_number)
{
llMapDestination( "HKPolyU Campus", <12>, 12>
<0> ); 0>
}
}
------------------Detect Landmark-----------------
string name;
string sim_name;
vector pos;
default
{
state_entry()
{
llAllowInventoryDrop(1);
if(llGetInventoryNumber(INVENTORY_LANDMARK))
{
name = llGetInventoryName(INVENTORY_LANDMARK,0);
request = llRequestInventoryData(name);
}
else
llWhisper(0,"Please drop a landmark on me");
}
dataserver(key id, string data)
{
if(id == request)
{
pos = (vector)data;
sim_name = llGetRegionName();
llSetText("Touch to show \""+name+"\" on the map.",<1 .0="">,1.0);1>
}
}
touch_start(integer a)
{
if(name != "")
llMapDestination(sim_name, pos, pos);
}
changed(integer a)
{
if(a & (CHANGED_INVENTORY | CHANGED_ALLOWED_DROP))
if(llGetInventoryNumber(INVENTORY_LANDMARK))
request = llRequestInventoryData(name = llGetInventoryName(INVENTORY_LANDMARK,0));
}
}
Ref:
http://www.aipiro.com/lsltips/index14.htm
http://lslwiki.net/lslwiki/wakka.php?wakka=HomePage
No comments:
Post a Comment