Bugün Second Life tek yerde Hediyeler ve freebie’ler her saat güncellenir 7 dil Ücretsiz mağazanı ekle
12:49 SLT Etkinliğini ekle+ Ekle
Grid sorunu
  • Planlı: Scheduled Billing Maintenance, 16 Kas Pzt 09:30–10:30 SLT
  • Grid durumu: Unscheduled Group Chat Maintenance (investigating)
  • Şimdi: UUtopia'da Unitarian Universalist Cumartesi Ayini
  • Şimdi: The Dharma of Community: Budist Toplum ve Householder
  • Şimdi: SLCS Harvest Fest: oyunlar, müzik ve eğlence
  • 14:00 SLT: Cascadia Moondance'te NAD GOUGH canlı performans, 14:00 SLT
  • Haberler: REZZ MALL: Second Life markaları tek bir web mağazasında
  • Viewer: Second Life Viewer 26.5 ile sohbet yenileniyor
  • Planlı: Scheduled Billing Maintenance, 16 Kas Pzt 09:30–10:30 SLT
  • Grid durumu: Unscheduled Group Chat Maintenance (investigating)
  • Şimdi: UUtopia'da Unitarian Universalist Cumartesi Ayini
  • Şimdi: The Dharma of Community: Budist Toplum ve Householder
  • Şimdi: SLCS Harvest Fest: oyunlar, müzik ve eğlence
  • 14:00 SLT: Cascadia Moondance'te NAD GOUGH canlı performans, 14:00 SLT
  • Haberler: REZZ MALL: Second Life markaları tek bir web mağazasında
  • Viewer: Second Life Viewer 26.5 ile sohbet yenileniyor
LSL script

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 satır ·

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 satır Bu scripti denetle
// 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();
    }
}

Ücretsizdir: kullanabilir, değiştirebilir ve sattıkların dahil kendi yapımlarına koyabilirsin.

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.

Kendi scriptini denetle: LSL sözdizimi denetleyicisi →

Diğer scriptlerTüm scriptler
LSL script · 55 satır

LSL kapı scripti: dokununca açılır, kendi kendine kapanır

Second Life için ücretsiz LSL kapı scripti. Dokununca açılıp kapanır, kapı menteşesi üzerinde döner ve birkaç saniye sonra kendiliğinden kapanır. Sesler isteğe bağlı.

LSL script · 69 satır

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 script · 96 satır

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.