Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Putting up a sign in SL?

VzNevada Menoptra
Registered User
Join date: 1 Nov 2005
Posts: 211
12-22-2005 06:45
I have noticed those great signs that say touch and read. How can I make one? If this isn't the correct area for asking this, then please direct me to it? Thanks.
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
12-22-2005 06:51
Here is the LSL Script code you'll need to accomplish it...

CODE
//Example Notecard Giver
//by Hank Ramos

//Add ONE notecard to the same prim contents as this script

default
{
touch_start(integer total_number)
{
integer x;

for (x = 0; x < total_number; x++)
{
llGiveInventory(llDetectedKey(x), llGetInventoryName(INVENTORY_NOTECARD, 0));
}
}
}


Just create a new prim, texture it, create a new script, paste the above code into the new script, add a notecard to the prim, done! :D

If you want to use a sensor and have the notecard automatically given to people who pass by over your land (they have to be over your land for this particular script to work), then use the folowing script instead...

CODE
//Notecard Giver via Sensor
//by Hank Ramos
list givenList;
float sensorRange = 15.0; //distance in meters from this prim that you want to scan, up to 96m

default
{
state_entry()
{
llSensorRepeat("", NULL_KEY, AGENT, sensorRange, TWO_PI, 10);
}

sensor(integer num_detected)
{
integer x;
key detectedKey;

//Loop through Agents Sensed on this pass
for (x = 0; x < num_detected; x++)
{
//Get key of Agent sensed
detectedKey = llDetectedKey(x);

//If the Agent hasn't been given this notecard yet and is over my land
if ((llListFindList(givenList, [detectedKey]) < 0) && (llOverMyLand(detectedKey)))
{
//Give the notecard
llGiveInventory(detectedKey, llGetInventoryName(INVENTORY_NOTECARD, 0));

//Add Agent to the list that has been given the notecard
givenList += detectedKey;

//If the list gets too big, slice off some of the earlier additions
if (llGetListLength(givenList) >= 80)
{
givenList = llDeleteSubList(givenList, 0, 59);
}
}

}
}
}

VzNevada Menoptra
Registered User
Join date: 1 Nov 2005
Posts: 211
12-22-2005 11:47
From: Hank Ramos
Here is the LSL Script code you'll need to accomplish it...

CODE
//Example Notecard Giver
//by Hank Ramos

//Add ONE notecard to the same prim contents as this script

default
{
touch_start(integer total_number)
{
integer x;

for (x = 0; x < total_number; x++)
{
llGiveInventory(llDetectedKey(x), llGetInventoryName(INVENTORY_NOTECARD, 0));
}
}
}


Just create a new prim, texture it, create a new script, paste the above code into the new script, add a notecard to the prim, done! :D

If you want to use a sensor and have the notecard automatically given to people who pass by over your land (they have to be over your land for this particular script to work), then use the folowing script instead...

CODE
//Notecard Giver via Sensor
//by Hank Ramos
list givenList;
float sensorRange = 15.0; //distance in meters from this prim that you want to scan, up to 96m

default
{
state_entry()
{
llSensorRepeat("", NULL_KEY, AGENT, sensorRange, TWO_PI, 10);
}

sensor(integer num_detected)
{
integer x;
key detectedKey;

//Loop through Agents Sensed on this pass
for (x = 0; x < num_detected; x++)
{
//Get key of Agent sensed
detectedKey = llDetectedKey(x);

//If the Agent hasn't been given this notecard yet and is over my land
if ((llListFindList(givenList, [detectedKey]) < 0) && (llOverMyLand(detectedKey)))
{
//Give the notecard
llGiveInventory(detectedKey, llGetInventoryName(INVENTORY_NOTECARD, 0));

//Add Agent to the list that has been given the notecard
givenList += detectedKey;

//If the list gets too big, slice off some of the earlier additions
if (llGetListLength(givenList) >= 80)
{
givenList = llDeleteSubList(givenList, 0, 59);
}
}

}
}
}



The first one is great...just one question: Where do I put MY text? I'm very new at this...I never did a script in my life. Thanks so much for your help :-)