Advertisement
Gayngel

Channel coms by llRezObject and on_rez - Rezzed Object

Mar 15th, 2023 (edited)
1,504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // This is a way to establish communication between a rezzer and the object it rezzers via llRezObject, on-rez and object_rez
  2.  
  3. // This script is for the object being rezzed.
  4.  
  5. integer gChan; // channel sent by rezzer
  6.  
  7. integer gHandle;
  8.  
  9. default
  10. {
  11.    on_rez(integer rez_param) // rez_param is the last parameter of llRezObject in the rezzer
  12.    {
  13.      
  14.        gChan = rez_param;
  15.        gHandle = llListen(gChan, "","",""); //listen on the channel to hear messages from the rezzer
  16.     }
  17.  
  18.     listen(integer chan, string name, key id, string msg)
  19.     {
  20.        
  21.        if(chan == gChan)
  22.        {
  23.            
  24.           llOwnerSay("Rezzer said: " + msg);
  25.            
  26.        }
  27.     }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement