Greeter script and building shub

implemented a greeter to build and made a model of shub niggurath from quake 1

When you walk through the door you hit a invisible square prim along the bottom that will prompt you to take a card that has info on it

//http://forums-archive.secondlife.com/54/01/101418/1.html
// VolDetect Notecard greeter
//
// Gives all notes in contents to new visitors and whispers a greeting.
// List is pruned automatically, reset script to clear
integer switch = 0;
integer newlist = 0;
key name;
list name_list;
// message whispered when new people arrive
string GreetMsg = “Welcome to James’s HP Lovecraft Museum.”;

//- – – – – – – – – – – – – – – –
integer isIn(list test_list, list test_item) // Looks for test_item
{ // in test_list
integer i;
// for (i = 0; i < llGetListLength(test_list); i++){
// if (llList2String(test_item, 0) == llList2String(test_list, i))
// return TRUE;
if (llListFindList(test_list, test_item) != -1) return TRUE;
// }
return FALSE;
}
//- – – – – – – – – – – – – – – –

default
{
state_entry()
{
llVolumeDetect(TRUE);
newlist = FALSE;
}

changed(integer chg)
{
if (chg & CHANGED_INVENTORY) llResetScript();
}

on_rez(integer r)
{
llResetScript();
}

collision_start(integer total_number)
{
integer j;
integer count = total_number;
list dnames = [];
string aname;
for (j = 0; j < count; j++)
{
if (llDetectedType(j) & AGENT)
{
aname = llDetectedKey(j);
if(aname != NULL_KEY)
{
// – KEYS now instead of names
if (!isIn(name_list, (list)aname)) {
name_list += (list)aname;
newlist = TRUE;
integer InvNum;
string NoteName;
integer NumCards = llGetInventoryNumber(INVENTORY_NOTECARD);
for ( InvNum = 0; InvNum < NumCards; InvNum++) {
NoteName = llGetInventoryName(INVENTORY_NOTECARD, InvNum);
llGiveInventory(aname, NoteName);
}
}
}
}
}
if (newlist)
{
newlist = FALSE;
llWhisper(0,GreetMsg);
}
while (llGetFreeMemory() < 512)
{
name_list = llList2List(name_list, 1, -1);
}
}
}

FirestormOS-Releasex64_2017-06-12_13-30-43.png

very fiddly to get the top tentacles to behave how i want.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s