Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a way to establish communication between a rezzer and the object it rezzers via object_rez and llGetObjectDetails
- // This script is for the object being rezzed
- integer gChan; // channel sent by rezzer
- integer gHandle;
- default
- {
- on_rez(integer rez_param) // rez_param is the last parameter of llRezObject in the rezzer
- {
- list details = llGetObjectDetails(llGetKey(),[OBJECT_REZZER_KEY]); // get the key of the rezzer in a list
- key rezzer = llList2Key(details,0); // extract the rezzer key from the list
- gChan = ((integer)("0x"+llGetSubString((string)rezzer,-8,-1)) - 6368) | 0x8000000; // create a unique chan with the key of the rezzer
- gHandle = llListen(gChan, "","",""); //listen on the channel to hear messages from the rezzer
- }
- listen(integer chan, string name, key id, string msg)
- {
- if(chan == gChan)
- {
- llOwnerSay("Rezzer said: " + msg);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement