User:Cow Taurog/Prim count

From Second Life Wiki
< User:Cow Taurog
Revision as of 23:30, 6 January 2009 by Cow Taurog (talk | contribs) (create)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Shows how many prims the parcel holds, and how many are left with hovertext. <lsl> 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);
   }

} </lsl>