0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

オブジェクトの中の ランドマークを探して タッチした人をテレポートさせるスクリプトサンプル

Posted at
LandmarkTP.LSL

// LM Teleport Script
// Written by いっちゃん
//
// オブジェクトの中の ランドマークを探して タッチした人をテレポートさせます
//


string lm_name;
key lm_id;
vector pos;

default
{

    state_entry()
    {
        lm_name = llGetInventoryName(INVENTORY_LANDMARK,0);
        
        //LM名を読み取り
        if(lm_name != "")
        {
            lm_id = llRequestInventoryData(lm_name);
        }
    }

    touch_start(integer total_number)
    {
        if(lm_name != "")
        {
            llMapDestination(llGetRegionName(), pos, ZERO_VECTOR);
        } 
    }

    dataserver(key qid, string data)
    {
        // LM 読み込み
        if (qid == lm_id)
        {
            lm_id = "";
            pos = (vector)data;
        }
    }

    changed(integer change)
    {
        if(change & CHANGED_INVENTORY)
        {
            llResetScript();
        }
    }
}


0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?