Notecard Giver
Touch it and it hands over the notecards in its Contents, with a floating label so people know it is worth touching.
What it does
On a touch it gives out a notecard. Name one in the settings and that is the one; leave the name empty and it gives every notecard it holds. A single card goes on its own, so it lands in the visitor's Notecards folder where they will look for it, while several go as one folder named after the object, which is the only way they stay together. It serves everybody who touched it at the same moment, not just the first, so a group arriving together does not have to queue.
What you can build with it
The rules by the door, the info board at the landing point, a welcome pack, instructions beside a build you are giving away, a menu outside a club, the terms on a rental box, a set of building notes next to a sandbox.
How to use it
Settings you can change
5Edit these at the top of the script. Everything works on the defaults · change them only when you need to.
// =====================================================================
// Notecard Giver
// skimi3d script library
// https://grid.skimi3d.com/scripts/notecard-giver
//
// Touch it and it hands over the notecards in its Contents. The sign
// by the door that gives you the rules, the info board at the landing
// point, the pack of instructions beside a build.
//
// Plain LSL.
// =====================================================================
// ---------------------------------------------------------------------
// Settings
// ---------------------------------------------------------------------
// Which notecard to give, by name. Left empty it gives EVERY notecard
// in its Contents at once, as a folder.
string NOTECARD = "";
// Floating words above it, so people know it is worth touching. Leave
// empty for no label.
string LABEL = "Touch for the house rules";
vector LABEL_COLOUR = <1.0, 1.0, 1.0>;
// What it says to whoever touched it. Empty says nothing.
string THANKS = "On its way. Look in your Inventory, under Notecards.";
// Who may take one. 0 = everyone, 1 = only the owner, 2 = same group.
integer WHO_MAY_TAKE = 0;
// ---------------------------------------------------------------------
// Everything below here is the machinery
// ---------------------------------------------------------------------
integer mayTake(key who)
{
if (WHO_MAY_TAKE == 1) return who == llGetOwner();
if (WHO_MAY_TAKE == 2) return llSameGroup(who);
return TRUE;
}
// Every notecard in Contents, by name.
list allCards()
{
list out = [];
integer n = llGetInventoryNumber(INVENTORY_NOTECARD);
integer i;
for (i = 0; i < n; ++i)
{
out += [llGetInventoryName(INVENTORY_NOTECARD, i)];
}
return out;
}
give(key who)
{
if (NOTECARD != "")
{
if (llGetInventoryType(NOTECARD) != INVENTORY_NOTECARD)
{
llOwnerSay("There is no notecard called \"" + NOTECARD + "\" in my Contents.");
llRegionSayTo(who, 0, "Sorry, there is nothing here to give you just now.");
return;
}
llGiveInventory(who, NOTECARD);
return;
}
list cards = allCards();
integer n = llGetListLength(cards);
if (n == 0)
{
llOwnerSay("I have no notecards in my Contents, so there is nothing to give.");
llRegionSayTo(who, 0, "Sorry, there is nothing here to give you just now.");
return;
}
// One card goes on its own, so it lands in Notecards where people
// look for it. Several go as a folder named after this object,
// which is the only way they stay together.
if (n == 1)
{
llGiveInventory(who, llList2String(cards, 0));
return;
}
llGiveInventoryList(who, llGetObjectName(), cards);
}
default
{
state_entry()
{
llSetText(LABEL, LABEL_COLOUR, 1.0);
}
touch_start(integer total)
{
// Everyone who touched, not just the first. A group arriving
// together should not have to queue at a sign.
integer i;
for (i = 0; i < total; ++i)
{
key who = llDetectedKey(i);
if (!mayTake(who))
{
llRegionSayTo(who, 0, "This one is not for you, sorry.");
}
else
{
give(who);
if (THANKS != "") llRegionSayTo(who, 0, THANKS);
}
}
}
changed(integer what)
{
if (what & CHANGED_INVENTORY) llSetText(LABEL, LABEL_COLOUR, 1.0);
}
on_rez(integer start)
{
llResetScript();
}
}
Copy it, make a new script inworld, paste over what is there and save. Nothing here phones home.