Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Rezzer
- string OBJECT_NAME = "thing"; // Name of object to rez
- vector OBJECT_OFFSET_POS = <0,0,3>; // Position to rez object at
- rotation OBJECT_OFFSET_ROT = ZERO_ROTATION;// Rotation to rez object at
- vector OBJECT_VELOCITY = ZERO_VECTOR; // Velocity to rez object at
- string DIE_SCRIPT_NAME = "die"; // Name of the die script
- integer PIN_MAX = 2147483647; // INT_MAX
- integer PIN_MIN = 1; // avoid 0 because it is used as the
- // start param when rezzed from inv
- integer OWNER_ONLY = FALSE; // If only owner can use
- key object_key = NULL_KEY; // Key of rezzed object
- integer object_rezzed = FALSE; // Whether object is rezzed
- integer object_pin; // PIN for rezzed object
- integer random_pin() {
- return llCeil( llFrand(PIN_MAX - PIN_MIN) ) + PIN_MIN;
- }
- default {
- touch_start(integer num) {
- if ( OWNER_ONLY && (llDetectedKey(0) != llGetOwner()) )
- return;
- if ( object_rezzed ) { // Object is already rezzed
- llRemoteLoadScriptPin( object_key, DIE_SCRIPT_NAME, object_pin, TRUE, TRUE );
- object_key = NULL_KEY;
- object_rezzed = FALSE;
- } else {
- object_pin = random_pin();
- llRezObject(
- OBJECT_NAME, llGetPos() + OBJECT_OFFSET_POS, OBJECT_VELOCITY,
- llGetRot() * OBJECT_OFFSET_ROT, object_pin
- );
- object_rezzed = TRUE;
- }
- }
- object_rez(key id) {
- object_key = id;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement