Difference between revisions of "Talk:Collision message sender"
Jump to navigation
Jump to search
m |
m |
||
Line 14: | Line 14: | ||
do | do | ||
{ | { | ||
user = llDetectedName( | user = llDetectedName(i); | ||
if ( llDetectedType(i) & AGENT ) | if ( llDetectedType(i) & AGENT ) | ||
{ | { | ||
Line 29: | Line 29: | ||
timer() | timer() | ||
{ | { | ||
llSetTimerEvent(0); // turn the timer off | llSetTimerEvent(0.0); // turn the timer off | ||
users = []; // clear the list | users = []; // clear the list | ||
llCollisionFilter("", NULL_KEY, TRUE); | llCollisionFilter("", NULL_KEY, TRUE); |
Latest revision as of 12:03, 20 March 2014
Probably better should be :
<lsl>
string message = " Merry Christmas "; // put your message here. list users; string user; float TIME=600.0; default {
collision_start(integer num_detected) // check for an avatar colliding with the prim. { integer i; do { user = llDetectedName(i); if ( llDetectedType(i) & AGENT ) { if (llListFindList(users,[user]) == -1)// look at the list, if the name is not there, { llSay(0, message + user); // send the message to the detected avatar. users += user; // add the users name to a list so they only get the message once. llSetTimerEvent(TIME); // change the number for the number of seconds before clearing the list. } } llCollisionFilter(user, "", FALSE); } while ( ++i < num_detected ); } timer() { llSetTimerEvent(0.0); // turn the timer off users = []; // clear the list llCollisionFilter("", NULL_KEY, TRUE); }
} </lsl>
because :
- when you want avoid collisions , you should use llCollisionFilter
- a collision can be an agent , but it can be too an object
- multiple collisions can happen in the same 1/22th second (same event )
Miranda Umino 13:00, 20 March 2014 (PDT)