Hello! I am trying to create a script with something like an alarm that sends me a message when someone comes to visit me in my absence. I managed to write something but its not ok.
It sends messages all the time while person in range, and I only need one time alert. and at the same time, if a person leaves the range and comes back, the alarm must be triggered again.
how to do it?
That's what i managed to write so far
float range = 10.0; // in meters
float rate = 10.0; // in seconds
default
{
state_entry()
{
llSensorRepeat( "", "", AGENT, range, TWO_PI, rate );
}
sensor( integer number_detected )
{
llInstantMessage( llGetOwner(), "ALERT!" );
}
}