Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- box(integer cstate){
- if(!cstate){//closed
- llSetLinkAlpha(2,1,-1);
- llSetLinkAlpha(3,0,-1);
- }
- if(cstate){//opened
- llSetLinkAlpha(2,0,-1);
- llSetLinkAlpha(3,1,-1);
- }
- }
- key sound_uuid = "02733e43-1ad9-237e-ce7a-8ac498fabcf0";// "af9f79fa-3b59-01f7-5eee-0dab9ef0e16c";
- default{
- on_rez(integer r){
- llResetScript();
- }state_entry(){
- box(0);
- llSetText("Touch me to unbox!",<0,1,0>,1);
- }touch_start(integer ts){
- if(llDetectedKey(0) != llGetOwner())return;
- llTriggerSound(sound_uuid,1);
- box(1);
- integer x = 0;
- integer s = llGetInventoryNumber(INVENTORY_ALL);
- list given;
- for(;x<s;++x){
- string cn = llGetInventoryName(INVENTORY_ALL,x);
- if(cn != llGetScriptName()){
- given += cn;
- }
- }
- llGiveInventoryList(llGetOwner(),llGetObjectName(),given);
- llDie();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement