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 llRezObject, on-rez and object_rez
- // This script is for the rezzer
- integer gChan; // a unique channel ro communicate between rezzer and object rezzed
- key obj_key; // key of object rezzed
- default
- {
- state_entry()
- {
- gChan = ((integer)("0x"+llGetSubString((string)llGetKey(),-8,-1)) - 6368) | 0x8000000; // establish a unique channel. - 6368 is just an offset in case that channel is 0;
- }
- collision_start(integer num)
- {
- llRezObject("sphere", llGetPos() + <0.0,0.0,1.0>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, gChan); // send the channel as the last parameter of llRezObject
- }
- object_rez(key id) // when the rezzer rezzes an object
- {
- obj_key = id; // get the key of the object rezzed
- }
- touch_end(integer num)
- {
- llRegionSayTo(obj_key, gChan, "Hello Mr Object!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement