Second Life today in one place Gifts & freebies updated every hour 7 languages Free to list your store
12:49 SLT List your event+ List
Grid issue
  • Planned: Scheduled Billing Maintenance, Mon, Nov 16 09:30–10:30 SLT
  • Grid status: Unscheduled Group Chat Maintenance (investigating)
  • On now: Unitarian Universalist Saturday Service in UUtopia
  • On now: The Dharma of Community: Buddhist Society and the Householder
  • On now: SLCS Harvest Fest: Games, Music and Fun at Cheertopia
  • 14:00 SLT: NAD GOUGH Live at Moondance in Cascadia, 2:00 PM SLT
  • News: REZZ MALL: Second Life brands in one web mall
  • Viewer: Second Life Viewer 26.5 Adds Chat Modernization
  • Planned: Scheduled Billing Maintenance, Mon, Nov 16 09:30–10:30 SLT
  • Grid status: Unscheduled Group Chat Maintenance (investigating)
  • On now: Unitarian Universalist Saturday Service in UUtopia
  • On now: The Dharma of Community: Buddhist Society and the Householder
  • On now: SLCS Harvest Fest: Games, Music and Fun at Cheertopia
  • 14:00 SLT: NAD GOUGH Live at Moondance in Cascadia, 2:00 PM SLT
  • News: REZZ MALL: Second Life brands in one web mall
  • Viewer: Second Life Viewer 26.5 Adds Chat Modernization
LSL script

LSL greeter script: welcome message for visitors

Free LSL visitor greeter for Second Life stores and clubs: a private welcome message once a day for each visitor who comes near, no spam in local chat.

59 lines ·

Say hello to every visitor without being online. This greeter script notices avatars that come near and sends each one a private welcome message, once a day. Only the visitor sees it, so local chat stays quiet, and the owner is never greeted.

lsl-greeter-script.lsl · 59 lines Check this script
// Visitor Greeter - free LSL script from WhatSL (https://whatsl.com/scripts/lsl-greeter-script)
// Free to use, change and put in your own creations, also ones you sell.
//
// Sends a private welcome message to each visitor who comes near, once a day.
// Only the visitor sees it, so it does not spam local chat. The owner is never greeted.

string  WELCOME_TEXT  = "Welcome, %name%! Have a look around and grab the free gift at the entrance.";
float   RANGE_METRES  = 20.0;  // how close a visitor must come (up to 96.0)
float   SCAN_SECONDS  = 10.0;  // how often to look for new visitors
integer MAX_REMEMBER  = 300;   // visitors remembered per day

list    gSeen = [];
integer gDay;

string fillName(string s, string name)
{
    integer i = llSubStringIndex(s, "%name%");
    if (i == -1) return s;
    return llInsertString(llDeleteSubString(s, i, i + 5), i, name);
}

default
{
    state_entry()
    {
        gDay = llGetUnixTime() / 86400;
        llSensorRepeat("", NULL_KEY, AGENT, RANGE_METRES, PI, SCAN_SECONDS);
    }

    on_rez(integer param)
    {
        llResetScript();
    }

    sensor(integer total)
    {
        integer today = llGetUnixTime() / 86400;
        if (today != gDay)
        {
            gDay = today;
            gSeen = [];
        }
        key owner = llGetOwner();
        integer i;
        for (i = 0; i < total; ++i)
        {
            key av = llDetectedKey(i);
            if (av != owner)
            {
                if (llListFindList(gSeen, [av]) == -1)
                {
                    llRegionSayTo(av, 0, fillName(WELCOME_TEXT, llGetDisplayName(av)));
                    gSeen += [av];
                    if (llGetListLength(gSeen) > MAX_REMEMBER) gSeen = llDeleteSubList(gSeen, 0, 0);
                }
            }
        }
    }
}

Free to use, change and put in your own creations, also ones you sell.

How to set it up

  1. Put the script in a small object near your landing point, such as a sign or an invisible prim.
  2. Write your message in WELCOME_TEXT. %name% becomes the visitor's display name.
  3. Save. Walk away, come back on another avatar or ask a friend to test it.

Settings

  • WELCOME_TEXT: the welcome message. Mention what is new, where the gift is, or your group.
  • RANGE_METRES: how close a visitor must come, up to 96 metres.
  • SCAN_SECONDS: how often the greeter looks for new visitors. 10 seconds is a good balance.
  • MAX_REMEMBER: how many visitors it remembers per day before it starts forgetting the oldest.

Tips

  • Keep the message short and friendly; one or two sentences.
  • Put one greeter near the landing point rather than several around the store, so visitors get one message.

Frequently asked questions

Do visitors get the message every time they come?

No. Each visitor is greeted once per day (by the server's UTC date).

Does the greeter store who visited?

It only keeps the keys of today's visitors in memory to avoid greeting twice, and forgets them the next day or when the script restarts.

Does the greeter cause lag?

A sensor every 10 seconds is light. Avoid scanning every second or using very many greeters on one region.

Check your own script: LSL syntax checker →

More scriptsAll scripts
LSL script · 55 lines

LSL door script: touch to open, closes by itself

Free LSL door script for Second Life. Touch to open and close, the door swings on its hinge and closes by itself after a few seconds. Sounds optional.

LSL script · 69 lines

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 lines

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.