Skip to content
lsl.devlsl.devLSL Dev

Dialog Message

LSL Header: {{LSL Header}}
A simple script thats lets anyone say a messages over a dialog instead of using llSay or llShout.

Usage: /channel dialog message

integer channel = 1000;

string token;
string data;

default
{
    state_entry()
    {
        llListen(channel, "", "", "");
    }
    
    on_rez(integer start_param)
    {
        llResetScript();
    }
        
    sensor(integer num_detected)
    { 
        if(token == "dialog")
        {
            integer i = 0;
            for(; i < num_detected; ++i)
                llDialog(llDetectedKey(i), data, [], channel );
        }
    }
    
    listen(integer chan, string name, key id, string command)
    {
        integer s = llSubStringIndex(command," ");
        if (~s)
        {
            token = llDeleteSubString(command, s, -1);
            data = llDeleteSubString(command, 0, s);
            if(token == "dialog")
                llSensor( "", "", AGENT, 32, PI );
        }
    }
}
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.

From the Second Life Wiki

Community documentation adapted from Dialog Message, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.