• Bitte schaltet eure Ad Blocker aus. SLinfo kann nur betrieben werden, wenn es durch Werbung Einnahmen erzielt. Vielen Dank!!
  • Wir freuen uns, wenn du dich in unserem Forum anmeldest. Bitte beachte, dass die Freigabe per Hand durchgeführt wird (Schutz vor Spammer). Damit kann die Freigabe bis zu 24 Stunden dauern.
  • Wir verwenden Cookies, um Inhalte und Anzeigen zu personalisieren, Funktionen für soziale Medien anbieten zu können und die Zugriffe auf unsere Website zu analysieren. Sie geben Einwilligung zu unseren Cookies, wenn Sie unsere Webseite weiterhin nutzen.

Random Animation Poseball Script

Franko Box

Nutzer
schmeisse dieses Script mit beliebigen Animationen in einen Poseball (Möbel) Das Script spielt die Animationen zufällig durch

PHP:
// Copyright 2010 (C) takuto Hastings
// modifed by takuto Hastings



// Jippen Faddoul's Poseball script - Low ram/lag posepall thats just drag-and drop simple
// Copyright (C) 2007 Jippen Faddoul
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License version 3, as
//    published by the Free Software Foundation.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>
 
 
 
//This text will appear in the floating title above the ball
string TITLE="";           
//You can play with these numbers to adjust how far the person sits from the ball. ( <X,Y,Z> )
vector offset=<0.0,0.0,0.5>;           
vector rot=<0.0,0.0,0.0>;
integer INTERVAL = 25;  // each pose time
///////////////////// LEAVE THIS ALONE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//string ANIMATION;
integer visible = TRUE;
key avatar;
 
vector COLOR = <1.0,1.0,1.0>;
float ALPHA_ON = 1.0;
float ALPHA_OFF = 0.0;

integer animation_count;
integer last_animation = -1;

start_animation_randam() {
    if (last_animation == -1)
        llStopAnimation("sit");
    else
        llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION, last_animation));
        
    last_animation = (integer)llFrand(animation_count);
//  llSay(0,(string)last_animation);
    llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION, last_animation));
}

show(){
    visible = TRUE;
    llSetText(TITLE, COLOR,ALPHA_ON);       
    llSetAlpha(ALPHA_ON, ALL_SIDES);
}
 
hide(){
    visible = FALSE;
    llSetText("", COLOR,ALPHA_ON);       
    llSetAlpha(ALPHA_OFF, ALL_SIDES);
}
 
default{
    state_entry() {
        llSitTarget(offset, llEuler2Rot(rot * DEG_TO_RAD));
        if((animation_count = llGetInventoryNumber(INVENTORY_ANIMATION)) <= 0){
            llWhisper(0, "Error: No animation");
            //ANIMATION = "sit";
        }
        llSetSitText(TITLE);
        show();
    }
 
//    touch_start(integer detected) {
//        //llOwnerSay("Memory: " + (string)llGetFreeMemory());
//        if(visible){ hide(); }
//        else       { show(); }
//    }
 
    changed(integer change) {
        if(change & CHANGED_LINK) {
            avatar = llAvatarOnSitTarget();
            if(avatar != NULL_KEY){
                //SOMEONE SAT DOWN
                hide();
                llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION);
                return;
            }else{
                //SOMEONE STOOD UP
                if (llGetPermissionsKey() != NULL_KEY){
                    llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION, last_animation));
                }
                last_animation = -1;
                llSetTimerEvent(0);
                show();
                return;
            }
        }
        if(change & CHANGED_INVENTORY) { llResetScript(); }
        if(change & CHANGED_OWNER)     { llResetScript(); }
    }
 
    run_time_permissions(integer perm) {
        if(perm & PERMISSION_TRIGGER_ANIMATION) {
            start_animation_randam();
            llSetTimerEvent(INTERVAL);
            hide();
        }
    }
    
    timer() {
        start_animation_randam();
    }
}
 

Users who are viewing this thread

Zurück
Oben Unten