きょうの Second Life をひとつの場所で ギフトとフリービー を毎時間更新 7言語 無料 でお店を掲載
グリッド障害
  • 予定: Scheduled Billing Maintenance, 11月16日(月) 09:30–10:30 SLT
  • グリッド状況: Unscheduled Group Chat Maintenance (investigating)
  • 開催中: UUtopiaのUnitarian Universalist土曜礼拝
  • 開催中: The Dharma of Community: 仏教社会と在家の生き方
  • 開催中: SLCSハーベストフェスト:ゲーム、音楽、お楽しみ
  • 14:00 SLT: Cascadiaのムーンダンスで NAD GOUGH ライブ 14:00 SLT
  • ニュース: REZZ MALL: Second Lifeのブランドが集まるウェブモール
  • Viewer: Second Life Viewer 26.5 チャットを刷新
  • 予定: Scheduled Billing Maintenance, 11月16日(月) 09:30–10:30 SLT
  • グリッド状況: Unscheduled Group Chat Maintenance (investigating)
  • 開催中: UUtopiaのUnitarian Universalist土曜礼拝
  • 開催中: The Dharma of Community: 仏教社会と在家の生き方
  • 開催中: SLCSハーベストフェスト:ゲーム、音楽、お楽しみ
  • 14:00 SLT: Cascadiaのムーンダンスで NAD GOUGH ライブ 14:00 SLT
  • ニュース: REZZ MALL: Second Lifeのブランドが集まるウェブモール
  • Viewer: Second Life Viewer 26.5 チャットを刷新
LSLスクリプト

LSL sit and pose script for chairs and pose balls

Free LSL sit script for Second Life chairs, benches and pose balls: sit and play your own animation, set the sit position, hide the ball while in use.

69行 ·

This sit and pose script turns any object into a seat. Put one animation in the object, sit on it, and the avatar plays that animation in the right spot. It works for chairs, sofas, rugs, bar stools and classic pose balls.

lsl-sit-pose-script.lsl · 69行 このスクリプトをチェック
// Sit and Pose - free LSL script from WhatSL (https://whatsl.com/scripts/lsl-sit-pose-script)
// Free to use, change and put in your own creations, also ones you sell.
//
// Put this script and ONE animation in a chair, bench, rug or pose ball.
// Sit on it and the avatar plays the animation. Change SIT_POS and SIT_ROT until the avatar sits right,
// then save the script again (or reset it) to apply the change.

vector  SIT_POS        = <0.0, 0.0, 0.5>;  // metres from the centre of the object (never use <0,0,0>)
vector  SIT_ROT        = <0.0, 0.0, 0.0>;  // degrees, for example <0.0, 0.0, 90.0> to turn the avatar
string  SIT_TEXT       = "Sit";            // the word on the right-click menu
integer HIDE_WHEN_USED = FALSE;            // TRUE = the object turns invisible while someone sits (pose ball)

key gSitter = NULL_KEY;

string poseAnim()
{
    return llGetInventoryName(INVENTORY_ANIMATION, 0);
}

default
{
    state_entry()
    {
        llSitTarget(SIT_POS, llEuler2Rot(SIT_ROT * DEG_TO_RAD));
        llSetSitText(SIT_TEXT);
    }

    changed(integer change)
    {
        if (change & CHANGED_INVENTORY) llResetScript();
        if (change & CHANGED_LINK)
        {
            key av = llAvatarOnSitTarget();
            if (av != NULL_KEY)
            {
                if (gSitter == NULL_KEY)
                {
                    gSitter = av;
                    llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);
                }
            }
            else if (gSitter != NULL_KEY)
            {
                // the avatar stood up: stop the pose if they are still in the region
                if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)
                {
                    if (llGetAgentSize(gSitter) != ZERO_VECTOR)
                    {
                        string a = poseAnim();
                        if (a != "") llStopAnimation(a);
                    }
                }
                gSitter = NULL_KEY;
                if (HIDE_WHEN_USED) llSetAlpha(1.0, ALL_SIDES);
            }
        }
    }

    run_time_permissions(integer perm)
    {
        if (perm & PERMISSION_TRIGGER_ANIMATION)
        {
            llStopAnimation("sit");
            string a = poseAnim();
            if (a != "") llStartAnimation(a);
            if (HIDE_WHEN_USED) llSetAlpha(0.0, ALL_SIDES);
        }
    }
}

自由に使用・改変でき、販売する作品にも組み込めます。

How to set it up

  1. Put the script and one animation (a sit pose, a lean, a dance) into the object's Contents.
  2. Sit on the object. The avatar plays the animation.
  3. If the avatar sits too high, too low or turned the wrong way, stand up, change SIT_POS or SIT_ROT, save the script and sit again.

Settings

  • SIT_POS: where the avatar sits, in metres from the object's centre. <0.0, 0.0, 0.5> is half a metre above it. Never set it to <0,0,0>: that turns the sit target off.
  • SIT_ROT: turns the avatar, in degrees. <0.0, 0.0, 90.0> turns them a quarter turn.
  • SIT_TEXT: the word shown on the right-click menu instead of "Sit".
  • HIDE_WHEN_USED: TRUE makes the object invisible while someone sits, like a classic pose ball.

Tips

  • Finding the perfect position takes a few tries. Change one number at a time by 0.05.
  • For a bench with two seats, use two invisible prims, each with this script and its own animation.

Frequently asked questions

Why does the avatar sit in the default sit pose?

The object probably has no animation in its Contents. Put one animation in the Contents and the script restarts by itself.

Does the sitter have to accept a permission?

No. Second Life gives animation permission automatically to the avatar sitting on the object.

Can I use this for a couple's pose?

This script handles one sitter. For couples and multiple poses, a free system such as AVsitter is a better choice.

自分のスクリプトをチェック: LSL構文チェッカー →

ほかのスクリプトすべてのスクリプト
LSLスクリプト · 55行

LSLのドアスクリプト:タッチで開閉し、自動で閉まる

Second Life用の無料LSLドアスクリプトです。ドアをタッチすると蝶番を軸に開き、もう一度タッチするか数秒後に自動で閉まります。閉じた位置を覚えるので、後からドアを動かしても問題なく動作し、効果音も設定できます。

LSLスクリプト · 96行

LSL tip jar script with thank-you message and total

Free LSL tip jar script for Second Life clubs, DJs, hosts and stores: quick pay buttons, a thank-you message, the total and last tipper in floating text.

LSLスクリプト · 101行

Freebie・グループギフト用LSLギフトスクリプト

SLストア向けの無料LSLギフトスクリプト。タッチするとすべてのアイテムを1つのフォルダでお渡し。全員向けにも、グループタグを付けた人だけ向けにも設定可能。