Skip to content
lsl.devlsl.devLSL Dev

GenUUID

Function notes

See also: String

Return value notes

Returns a string that is a clone look of a uuid, these keys are not registered within SL.

Specification

string  genUUID() {
    string characters = "0123456789abcdefghijklmnopqrstuvwxyz";
    float len = (float)llStringLength(characters);
    string emp;
    integer i = 32;
    integer p;
    do
       emp += llGetSubString(characters, p = (integer)llFrand(len), p);
    while(--i);
    return llGetSubString(emp,0,7) + "-" + llGetSubString(emp,8,11)+ "-" + llGetSubString(emp,12,15)+ "-" + llGetSubString(emp,16,19)+ "-" + llGetSubString(emp,20,31);
}

Examples

default
{
    touch_start(integer total_number)
    {
        llSay(0, genUUID());
    }
}

//Says something like  4kwlhahj-ilpw-df7v-wv8i-3i7m9gx6309
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 GenUUID, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

  • GenUUID (revision 1194816, )

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.