Difference between revisions of "User:Cow Taurog/Prim count"

From Second Life Wiki
Jump to navigation Jump to search
(create)
 
m
 
Line 1: Line 1:
Shows how many prims the parcel holds, and how many are left with hovertext.
Shows how many prims the parcel holds, and how many are left with hovertext.
<lsl>
<source lang="lsl2">
vector gvColor=<0,0.5,1>;
vector gvColor=<0,0.5,1>;
integer giMaxPrims;
integer giMaxPrims;
Line 23: Line 23:
     }
     }
}
}
</lsl>
</source>

Latest revision as of 23:49, 22 July 2015

Shows how many prims the parcel holds, and how many are left with hovertext.

vector gvColor=<0,0.5,1>;
integer giMaxPrims;
integer giPrimCount;
integer giPrimsLeft;
float gfDelay=1;
 
default{
    state_entry(){
        giMaxPrims = llGetParcelMaxPrims(llGetPos(),FALSE);
        giPrimCount = llGetParcelPrimCount(llGetPos(),0,FALSE);
        giPrimsLeft = (giMaxPrims - giPrimCount);
        llSetText((string)giPrimsLeft + " prims left.",gvColor,1);
        llSetTimerEvent(gfDelay);
    }
 
    timer(){
        giMaxPrims = llGetParcelMaxPrims(llGetPos(),FALSE);
        giPrimCount = llGetParcelPrimCount(llGetPos(),0,FALSE);
        giPrimsLeft = (giMaxPrims - giPrimCount);
        llSetText((string)giPrimsLeft + " prims left.",gvColor,1);
    }
}