Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Rezzer-system-main-v3
- integer MEMORY_LENGTH = 250;
- list givenList;
- integer gInboundCmdChannel = 995;
- integer gOutboundCmdChannel = 996;
- string RSTART="rstart";
- integer multi = TRUE;
- integer gListenChannel = 989;
- integer gListenHandle;
- float gExpiration = 75.0;
- list menuitems;
- string notecard = "New Scene Help";
- vector myPos;
- integer tI;
- string tS;
- string gOpenClosed;
- string RSTOP="rstop";
- string OpenSound1 = "270ce06c-bce5-7d9f-af9f-1d0accaf3a5b"; //connection established sound
- float OpenVol1 = 1.0;
- string OpenSound2 = "395e6234-3b87-2394-1e6c-6569986916b1"; //transition sound
- float OpenVol2 = 1.0;
- string OpenSound3 = "64f092ad-7f34-5a44-f2c4-6559ecdd6b86"; //genie sound
- float OpenVol3 = 1.0;
- string OpenSound4 = "583f4aa4-5432-4555-8830-4b4a3bd0d808";
- float OpenVol4 = 1.0;
- string OpenSound5 = "64f092ad-7f34-5a44-f2c4-6559ecdd6b86";
- float OpenVol5 = 1.0;
- key tK;
- key crate = "bcf02ab6-1cf8-fc38-0a50-94f9cf1c6c8b";
- init() {
- }
- default
- {
- on_rez(integer param) {
- llResetScript();
- init();
- }
- state_entry() {
- init();
- llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, .05);
- state ready;
- }
- }
- state ready
- {
- state_entry()
- {
- llOwnerSay( "Ready. Click to start." );
- llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, .05);
- if(OpenSound1 != "") llTriggerSound(OpenSound1, OpenVol1);
- }
- touch_start( integer num )
- {
- if ( llDetectedKey ( 0 ) == llGetOwner() )
- {
- llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, .05);
- if(OpenSound1 != "") llTriggerSound(OpenSound1, OpenVol1);
- state build;
- }
- }
- }
- state build
- {
- state_entry()
- {
- llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, .05);
- llListen(gListenChannel, "", llGetOwner(),"");
- if(OpenSound2 != "") llTriggerSound(OpenSound2, OpenVol2);
- }
- touch_end(integer total_number) {
- if(OpenSound1 != "") llTriggerSound(OpenSound1, OpenVol1);
- key who = llDetectedKey(0);
- integer cmdChannel = (integer)llFrand(-200000) - 100;
- integer i;
- integer iCount=llGetInventoryNumber(INVENTORY_OBJECT);
- menuitems = [];
- for(i=iCount - 1; i>=0; i--)
- {
- string name = llGetInventoryName(INVENTORY_OBJECT, i);
- if (llGetScriptName() != name) {
- menuitems += name;
- }
- }
- list choices = llList2ListStrided(menuitems, 0, -1, 2);
- llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, .05);
- if(OpenSound2 != "") llTriggerSound(OpenSound2, OpenVol2);
- llDialog(who, "Select a menu item", menuitems, cmdChannel);
- gListenHandle = llListen(cmdChannel, "", who, "");
- }
- listen(integer ch, string name, key id, string message) {
- integer choice = llListFindList(menuitems, [message]);
- if (message == "New Scene") {
- llSay(0,"CLEAR");
- vector vThisPos=llGetPos();
- rotation rThisRot=llGetRot();
- llOwnerSay( "New scene crate created" );
- if(OpenSound3 != "") llTriggerSound(OpenSound3, OpenVol2);
- //llGiveInventory(llDetectedKey(0), "New Scene Help");
- llRezObject(message, vThisPos+<0,0,.3>, ZERO_VECTOR, ZERO_ROTATION, 0 );
- } else if (llToLower(message) == "clear"){
- if(OpenSound5 != "") llTriggerSound(OpenSound5, OpenVol5);
- llDie();
- } else {
- llSay(0,"CLEAR");
- vector vThisPos=llGetPos();
- rotation rThisRot=llGetRot();
- llRezObject(message, vThisPos+<0,0,.3>, ZERO_VECTOR, ZERO_ROTATION, 0 );
- llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);
- if(OpenSound4 != "") llTriggerSound(OpenSound4, OpenVol4);
- llSay(gOutboundCmdChannel, RSTART);
- llSay(0, "BUILD");
- }
- }
- }
- state needs_something
- {
- on_rez( integer num)
- {
- state default;
- }
- touch_start( integer num )
- {
- if ( llDetectedKey ( 0 ) == llGetOwner() )
- {
- state default;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement