Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Notecard Script Giver

Mecha Innis
Registered User
Join date: 28 Nov 2006
Posts: 49
11-19-2009 16:46
Hi,

Does anyone know how to modify this script to give a notecard with information that I want to include in the notecard.

{
touch_start(integer total_number)
{
for(x = 0; x < total_number; x++)
llGiveInventory(llDetectedKey(x), llGetInventoryName(INVENTORY_NOTECARD, 0));
}
}
Paul Wardark
Wait, what?
Join date: 10 Jan 2009
Posts: 383
11-19-2009 16:48
default
{
touch_start(integer total_number)
{
llGiveInventory(llDetectedKey(0), llGetInventoryName(INVENTORY_NOTECARD, 0));
}
}
_____________________
Mecha Innis
Registered User
Join date: 28 Nov 2006
Posts: 49
11-19-2009 17:01
Sorry, figured it out. I needed to put a notecard in the object as well.
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
11-19-2009 17:12
From: Paul Wardark
default
{
touch_start(integer total_number)
{
llGiveInventory(llDetectedKey(0), llGetInventoryName(INVENTORY_NOTECARD, 0));
}
}


This is the INCORRECT way to handle events that pass a "total_number". If you implement the code this way, if two people click the notecard giver prim at the same time then only the first person will get the notecard. The second person will be left "scratching their head" wondering why the notecard giver isn't working as they didn't receive a card.

Use the code specified by the OP instead.
Mecha Innis
Registered User
Join date: 28 Nov 2006
Posts: 49
11-20-2009 07:40
thanks