CODE
integer gCount;
integer gDieAt = 999; //tunable
float gInterval = 10; //seconds (also tunable)
default
{
state_entry()
{
llSetTimerEvent(gInterval);
}
timer()
{
if(llGetLandOwnerAt(llGetPos()) == NULL_KEY)
{
if(gCount >= gDieAt) llDie();
gCount ++;
}
else
{
gCount = 0;
}
}
}
This code will check every ten seconds what the land owner is at the current object's position. If the land is public (land owner = NULL_KEY), it adds one to count. If it isnt, it resets the count (just incase the object is a vehicle that just moved over some public land that one instance.)
created by christopher omega
EDIT: Xerahn VonLenard, ty so much... Adding >= to the if(gCount >= gDieAt) is definately more stable then if(gCount == gDieAt)... just in case the sim hiccups. Ty so much for the input.