きょうの 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 texture changer script (touch to change texture)

Free LSL texture changer for Second Life: touch to cycle through textures by UUID, one face or the whole linkset, safe for items you sell.

37行 ·

Let people pick a colour or pattern with one click. This texture changer switches the object to the next texture each time it is touched. It works with texture UUIDs instead of names, which matters if you sell or give the item: in a buyer's copy, textures referenced by name often fail because they are not transferable.

lsl-texture-changer-script.lsl · 37行 このスクリプトをチェック
// Texture Changer - free LSL script from WhatSL (https://whatsl.com/scripts/lsl-texture-changer-script)
// Free to use, change and put in your own creations, also ones you sell.
//
// Touch to switch to the next texture in TEXTURE_LIST.
// It uses texture UUIDs (not names), so it keeps working in copies you give away or sell.
// To get a UUID: right-click a full-permission texture in your inventory > Copy Asset UUID.

list    TEXTURE_LIST  = [TEXTURE_PLYWOOD, TEXTURE_BLANK];  // replace with your own texture UUIDs in quotes
integer TEXTURE_FACE  = ALL_SIDES;  // ALL_SIDES, or one face number such as 0
integer WHOLE_LINKSET = FALSE;      // TRUE = change every prim of the linked object
integer OWNER_ONLY    = FALSE;      // TRUE = only the owner can change it

integer gIndex = 0;

showTexture()
{
    string tex = llList2String(TEXTURE_LIST, gIndex);
    if (WHOLE_LINKSET) llSetLinkTexture(LINK_SET, tex, TEXTURE_FACE);
    else llSetTexture(tex, TEXTURE_FACE);
}

default
{
    state_entry()
    {
        if (llGetListLength(TEXTURE_LIST) > 0) showTexture();
    }

    touch_start(integer total)
    {
        if (OWNER_ONLY && llDetectedKey(0) != llGetOwner()) return;
        integer count = llGetListLength(TEXTURE_LIST);
        if (count == 0) return;
        gIndex = (gIndex + 1) % count;
        showTexture();
    }
}

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

How to set it up

  1. Find the UUID of each texture: in your inventory, right-click a full-permission texture and choose Copy Asset UUID.
  2. Put the UUIDs in TEXTURE_LIST, each in quotes and separated by commas, for example ["uuid-one", "uuid-two"].
  3. Add the script to the object and save. Touch it to cycle through the textures.

Settings

  • TEXTURE_LIST: the textures to cycle through. The example uses two built-in textures so you can test it straight away.
  • TEXTURE_FACE: ALL_SIDES, or one face number to change only that face.
  • WHOLE_LINKSET: TRUE changes every prim of a linked object at once.
  • OWNER_ONLY: TRUE lets only the owner change the texture.

Tips

  • To find a face number, use Select Face in the Edit window and look at the texture tab.
  • This script changes classic textures. Objects that use PBR (glTF) materials need a different method.

Frequently asked questions

Why do my textures not change in the copy I sold?

Scripts that set textures by their inventory name fail when the texture is no-transfer for the buyer. This script uses UUIDs, so it keeps working.

Can I change colour instead of texture?

Yes, with a small change: put colours such as <1.0, 0.0, 0.0> in the list and, in showTexture(), use llSetColor(llList2Vector(TEXTURE_LIST, gIndex), TEXTURE_FACE) instead of the two texture lines.

Can I go back to the first texture?

Yes. After the last texture the script starts again at the first one.

自分のスクリプトをチェック: 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.