I have been messing around with 2 scripts and have each doing part of what I want, but neither one does all.
I can get either a local say to come up from the notecard upon collision, or I can get a popup to display the text I want in the actual script, but what I was hoping might happen is combining the two scripts so that upon collision- an avatar steps on the "door mat" the script reads the text I want it to say in the popup- from a notecard rather than the script.
I think it would be easier and better to drop the script in and leave it alone, and when I want to change the text I can simply do so in the notecard.
So I have this script and I have a fair idea how this works, tho Im still learning. experimenting with inserting the lldialog lines from the other script, it produced an error, so i'm not sure what needs to be added or altered to do this.
Here is the script I could use for this, as it is;
// From the book:
//
// Scripting Recipes for Second Life
// by Jeff Heaton (Encog Dod in SL)
// ISBN: 160439000X
// Copyright 2007 by Heaton Research, Inc.
//
// This script may be freely copied and modified so long as this header
// remains unmodified.
//
// For more information about this book visit the following web site:
//
// http://www.heatonresearch.com/articles/series/22/
integer index;
key query;
default
{
collision_start(integer num_detected)
{
llSensor("", NULL_KEY, AGENT, 20, PI); //This scans on touch
}
sensor(integer total_number)
{
index = 0;
query = llGetNotecardLine("note",index++);
llSetTimerEvent(10);
}
timer()
{
query = llGetNotecardLine("note",index++);
}
dataserver(key query_id, string data)
{
if (query == query_id)
{
// this is a line of our notecard
if (data == EOF)
{
llSetTimerEvent(0);
} else
{
// increment line count
llSay(0, data);
}
}
}
}
And then here is part of the other script which I changed from a touch_start to collision_start and that aspect does what I want. The llDialog text I have in here I'd rather have in a notecard;
collision_start(integer num_detected)
{
llSensor("", NULL_KEY, AGENT, 20, PI); //This scans on touch
}
sensor(integer total_number)
{
integer current_agent;
for (current_agent = 0; current_agent < total_number; current_agent++) llDialog(llDetectedKey(current_agent), "Please WAIT for the signs to rez as they display the rules and what you need to know BEFORE going to the sim!", ["I Agree"], -12345);