Second Life heute an einem Ort Geschenke & Freebies stündlich aktualisiert 7 Sprachen Kostenlos deinen Store eintragen
12:49 SLT Event eintragen+ Eintragen
Grid-Störung
  • Geplant: Scheduled Billing Maintenance, Mo., 16. Nov. 09:30–10:30 SLT
  • Grid-Status: Unscheduled Group Chat Maintenance (investigating)
  • Jetzt: Unitarian Universalist Samstagsgottesdienst in UUtopia
  • Jetzt: The Dharma of Community: Buddhistische Gesellschaft und der Householder
  • Jetzt: SLCS Harvest Fest: Spiele, Musik und Spaß
  • 14:00 SLT: NAD GOUGH live im Moondance in Cascadia, 14:00 Uhr SLT
  • News: REZZ MALL: Second-Life-Marken in einem Web-Mall
  • Viewer: Second Life Viewer 26.5 mit modernisiertem Chat
  • Geplant: Scheduled Billing Maintenance, Mo., 16. Nov. 09:30–10:30 SLT
  • Grid-Status: Unscheduled Group Chat Maintenance (investigating)
  • Jetzt: Unitarian Universalist Samstagsgottesdienst in UUtopia
  • Jetzt: The Dharma of Community: Buddhistische Gesellschaft und der Householder
  • Jetzt: SLCS Harvest Fest: Spiele, Musik und Spaß
  • 14:00 SLT: NAD GOUGH live im Moondance in Cascadia, 14:00 Uhr SLT
  • News: REZZ MALL: Second-Life-Marken in einem Web-Mall
  • Viewer: Second Life Viewer 26.5 mit modernisiertem Chat
LSL-Skript

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 Zeilen ·

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 Zeilen Dieses Skript prüfen
// 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();
    }
}

Frei nutzbar, änderbar und in eigenen Kreationen verwendbar, auch in solchen, die du verkaufst.

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.

Eigenes Skript prüfen: LSL-Syntaxprüfer →

Weitere SkripteAlle Skripte
LSL-Skript · 55 Zeilen

LSL-Tür-Skript: Berühren zum Öffnen, schließt sich selbst

Kostenloses LSL-Türskript für Second Life. Berühren zum Öffnen und Schließen, die Tür schwingt um ihr Scharnier und schließt sich nach einigen Sekunden selbst. Geräusche optional.

LSL-Skript · 69 Zeilen

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-Skript · 96 Zeilen

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.