きょうの 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スクリプト

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

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

101行 ·

すべてのストアにはギフトギバーが必要です。このスクリプトは、誰かがタッチするとオブジェクトのContents内のすべてのアイテムを、整理された1つのフォルダとして配ります。GROUP_ONLYをオンにすると、グループギフトボードになります。ストアのグループタグを付けているレジデントだけがギフトを受け取れます。

lsl-gift-giver-script.lsl · 101行 このスクリプトをチェック
// Gift Giver (everyone or group only) - free LSL script from WhatSL (https://whatsl.com/scripts/lsl-gift-giver-script)
// Free to use, change and put in your own creations, also ones you sell.
//
// Put this script and your gift items in an object. Touch it to receive everything in its Contents
// (except this script) as one folder. Items must be copyable for the next owner.
// With GROUP_ONLY = TRUE, only residents wearing the same group tag as the object get the gift:
// set the object's group in the Edit window (General tab) first.

integer GROUP_ONLY       = FALSE;
string  FOLDER_NAME      = "";    // "" = use the object's name
string  THANK_YOU        = "Enjoy your gift! It is in your inventory.";
string  NO_GROUP_TEXT    = "Sorry, this gift is for group members. Wear the group tag and touch me again.";
integer COOLDOWN_SECONDS = 60;    // the same avatar can take the gift again after this time

list gRecent = [];   // [avatar key, unix time, ...]

string folderName()
{
    if (FOLDER_NAME != "") return FOLDER_NAME;
    return llGetObjectName();
}

list giftItems()
{
    list out = [];
    string me = llGetScriptName();
    integer n = llGetInventoryNumber(INVENTORY_ALL);
    integer i;
    for (i = 0; i < n; ++i)
    {
        string name = llGetInventoryName(INVENTORY_ALL, i);
        if (name != me) out += [name];
    }
    return out;
}

giveGift(key who, integer sameGroup)
{
    if (GROUP_ONLY)
    {
        // an object without a group would let everyone in, so check that a group is set
        key objGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);
        if (objGroup == NULL_KEY)
        {
            llRegionSayTo(who, 0, "This gift giver is not set up yet.");
            return;
        }
        if (!sameGroup)
        {
            llRegionSayTo(who, 0, NO_GROUP_TEXT);
            return;
        }
    }
    integer now = llGetUnixTime();
    integer i = llListFindList(gRecent, [who]);
    if (i != -1)
    {
        if (now - llList2Integer(gRecent, i + 1) < COOLDOWN_SECONDS)
        {
            llRegionSayTo(who, 0, "You already have this gift. Look for the folder \"" + folderName() + "\" in your inventory.");
            return;
        }
        gRecent = llDeleteSubList(gRecent, i, i + 1);
    }
    list stuff = giftItems();
    if (llGetListLength(stuff) == 0)
    {
        llRegionSayTo(who, 0, "This gift giver is empty right now.");
        return;
    }
    llGiveInventoryList(who, folderName(), stuff);
    llRegionSayTo(who, 0, THANK_YOU);
    gRecent += [who, now];
    if (llGetListLength(gRecent) > 200) gRecent = llDeleteSubList(gRecent, 0, 1);
}

default
{
    state_entry()
    {
        if (GROUP_ONLY)
        {
            key objGroup = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_GROUP]), 0);
            if (objGroup == NULL_KEY) llOwnerSay("GROUP_ONLY is on, but this object has no group. Set the group in the Edit window (General tab), then reset the script.");
        }
    }

    touch_start(integer total)
    {
        integer d;
        for (d = 0; d < total; ++d)
        {
            giveGift(llDetectedKey(d), llDetectedGroup(d));
        }
    }

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

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

セットアップ方法

  1. ギフト用の箱、看板、またはポスターを出現させ、スクリプトをそのContents内に入れます。
  2. ギフトのアイテム(服、家具、ランドマーク、ノートカード)を追加します。次のオーナーに渡せるようにコピー可能である必要があります。
  3. グループギフトにする場合は、GROUP_ONLYをTRUEに設定し、編集ウィンドウの一般タブでオブジェクトのグループを設定します。スクリプトを再度保存します。
  4. ギバーをタッチしてテストします。ギフトはオブジェクト名のフォルダとして届きます。

設定

  • GROUP_ONLY: FALSEは全員に配布します。TRUEはオブジェクトのグループタグを付けているレジデントだけに配布します。
  • FOLDER_NAME: ギフトが届くフォルダの名前です。空欄の場合はオブジェクト名を使います。
  • THANK_YOUとNO_GROUP_TEXT: レジデントに表示されるメッセージです。
  • COOLDOWN_SECONDS: 同じアバターが誤って何度もギフトを受け取るのを防ぎます。

ヒント

  • Contents内のアイテムを入れ替えれば、毎月ギフトを変えられます。スクリプトを変更する必要はありません。
  • ストアへのランドマークとお礼を書いた短いノートカードをギフトに入れましょう。
  • より多くのレジデントに見つけてもらえるよう、ギフトをWhatSLに無料で掲載しましょう。

よくある質問

グループのメンバーなのに、なぜ「このギフトはグループメンバー向けです」と表示されるのですか?

そのレジデントはグループに入っていますが、別のグループタグがアクティブになっています。アクティブグループを御社のグループに切り替えてから、もう一度タッチするよう伝えてください。

フォルダの中に一部のアイテムがないのはなぜですか?

次のオーナーにコピーできないアイテムは、フォルダでお渡しできません。コピー可能に変更するか、コピー不可のアイテムごとに別のギバーを使ってください。

ランドマークも渡せますか?

はい。スクリプト自体を除き、Contents内のものはランドマークやノートカードを含めてすべてお渡しされます。

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

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

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

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

LSLスクリプト · 69行

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.

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.