Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Looking for a script that gives notecards to people when they enter my sim

Chaos Bikcin
Registered User
Join date: 10 Jun 2007
Posts: 296
11-05-2007 17:21
Hi i have been working on this script for 4 months, and still not got anywhere
I need a script that gives out a notecard ONCE to someone, not spam them over & over.
anyone know if this is possable in SL yet?
_____________________
www.felonhall.com
Abba Thiebaud
PerPetUal NoOb
Join date: 20 Aug 2006
Posts: 563
11-05-2007 17:33
/54/1b/187662/1.html#post1530796

OH and, check this out:



Just thought it was funny, no offence to you. :)

A
_____________________
http://www.ponystars.com/abbathiebaud Pony Up.
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
11-05-2007 17:49
Noticed the post on Resident Answers, too... seems collision trigger is desired, and some sort of agree/disagree dialog. Hacked this together quickly, but might give some clues:

CODE

integer COLLIDED_MAX = 30;
integer dialogChannel;
list collided;
integer colIdx;

default
{
state_entry()
{
dialogChannel = (integer)llFrand(-1000000000) - 1000000000;
for (colIdx = 0; colIdx < COLLIDED_MAX; colIdx += 1)
collided = [] + collided + NULL_KEY;
}
collision_start(integer num_detected)
{
key collider = llDetectedKey(0);
if (-1 == llListFindList(collided, (list)collider))
{
llGiveInventory(collider, llGetInventoryName(INVENTORY_NOTECARD, 0));
colIdx = (colIdx + 1) % COLLIDED_MAX;
collided = llListReplaceList(collided, (list)collider, colIdx, colIdx);
llListen(dialogChannel, "", collider, "");
llDialog(collider, "Do you agree to the rules?", ["Yes", "No"], dialogChannel);
}
}
listen(integer channel, string name, key id, string message)
{
if (message == "Yes")
{
//do stuff for agreeing patrons
llInstantMessage(id, "Welcome to fooby's frobitz!");
}
else
if (message == "No")
{
//do stuff to disagreeing folks
llInstantMessage(id, "May bad things happen to you for disagreeing.");
}
}
}