Second Life hoje em um só lugar Presentes e freebies atualizados a cada hora 7 idiomas Grátis para divulgar sua loja
Problema no grid
  • Programado: Scheduled Billing Maintenance, seg., 16 de nov. 09:30–10:30 SLT
  • Status do grid: Unscheduled Group Chat Maintenance (investigating)
  • Agora: Culto Unitarian Universalist de Sábado em UUtopia
  • Agora: The Dharma of Community: Sociedade Budista e o Householder
  • Agora: Harvest Fest da SLCS: jogos, música e diversão
  • 14:00 SLT: NAD GOUGH ao vivo no Moondance em Cascadia, 14:00 SLT
  • Notícias: REZZ MALL: marcas de Second Life em um shopping online
  • Viewer: Second Life Viewer 26.5 traz modernização do chat
  • Programado: Scheduled Billing Maintenance, seg., 16 de nov. 09:30–10:30 SLT
  • Status do grid: Unscheduled Group Chat Maintenance (investigating)
  • Agora: Culto Unitarian Universalist de Sábado em UUtopia
  • Agora: The Dharma of Community: Sociedade Budista e o Householder
  • Agora: Harvest Fest da SLCS: jogos, música e diversão
  • 14:00 SLT: NAD GOUGH ao vivo no Moondance em Cascadia, 14:00 SLT
  • Notícias: REZZ MALL: marcas de Second Life em um shopping online
  • Viewer: Second Life Viewer 26.5 traz modernização do chat
Script LSL

Script LSL de gift giver para freebies e group gifts

Gift giver LSL grátis para lojas de Second Life: toque para receber todos os itens em uma pasta, para todos ou só para membros do grupo com a tag.

101 linhas ·

Toda loja precisa de um gift giver. Este script entrega tudo que está no Contents de um objeto como uma pasta organizada quando alguém toca nele. Ative GROUP_ONLY e ele vira um quadro de group gifts: só residentes usando a tag do grupo da sua loja recebem o presente.

lsl-gift-giver-script.lsl · 101 linhas Verificar este script
// 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();
    }
}

Livre para usar, alterar e colocar nas suas criações, inclusive nas que você vende.

Como configurar

  1. Rez uma caixa, placa ou pôster para o seu presente e coloque o script no Contents dele.
  2. Adicione os itens do presente (roupas, móveis, um landmark, um notecard). Eles precisam ser copiáveis para o próximo dono.
  3. Para um group gift, defina GROUP_ONLY como TRUE e escolha o grupo do objeto na janela Edit, aba General. Salve o script novamente.
  4. Toque no giver para testar. O presente chega como uma pasta com o nome do objeto.

Configurações

  • GROUP_ONLY: FALSE entrega para todos; TRUE entrega só para residentes usando a tag do grupo do objeto.
  • FOLDER_NAME: o nome da pasta onde o presente chega; vazio usa o nome do objeto.
  • THANK_YOU e NO_GROUP_TEXT: as mensagens que os residentes veem.
  • COOLDOWN_SECONDS: impede que o mesmo avatar pegue o presente várias vezes sem querer.

Dicas

  • Troque o presente todo mês trocando os itens no Contents; o script não precisa mudar.
  • Coloque um notecard curto no presente com um landmark para sua loja e um agradecimento.
  • Cadastre seu presente no WhatSL de graça para mais residentes encontrarem.

Perguntas frequentes

Por que um residente do meu grupo recebe "this gift is for group members"?

Ele está no grupo, mas com outra tag de grupo ativa. Peça para ele deixar o seu grupo como grupo ativo e tocar de novo.

Por que alguns itens não aparecem na pasta?

Itens no-copy para o próximo dono não podem ser entregues em uma pasta. Torne-os copiáveis ou use um giver separado para cada item no-copy.

Posso dar um landmark também?

Sim. Tudo que estiver no Contents, exceto o próprio script, é entregue, incluindo landmarks e notecards.

Verifique seu próprio script: Verificador de sintaxe LSL →

Mais scriptsTodos os scripts
Script LSL · 55 linhas

Script de porta LSL: toque para abrir, fecha sozinha

Script de porta LSL grátis para Second Life. Toque para abrir e fechar: a porta gira na dobradiça e se fecha sozinha após alguns segundos. Sons opcionais.

Script LSL · 69 linhas

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.

Script LSL · 96 linhas

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.