LoginSignup
1
0

More than 5 years have passed since last update.

アバターをテレポートさせるスクリプト

Last updated at Posted at 2017-05-20

このスクリプトとランドマークをオブジェクトの中に入れてください。
タッチしたアバターをランドマークの場所にテレポートさせます。

Teleport.LSL

key avator;
string lm_fname;
vector pos = ZERO_VECTOR;
vector look_at = ZERO_VECTOR;

default
{
    state_entry()
    {
        lm_fname = llGetInventoryName(INVENTORY_LANDMARK,0);
    }

    touch_start(integer total_num)
    {
        avator = llDetectedKey(0);
        llRequestPermissions(avator, PERMISSION_TELEPORT);
    }

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

    run_time_permissions(integer perm)
    {
        if(PERMISSION_TELEPORT & perm)
        {
            llTeleportAgent(avator, lm_fname, pos, look_at);
        }
    }
}

1
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
1
0