CODE
default
{
on_rez(integer x)
{
llResetScript();
}
state_entry()
{
llSetTimerEvent(1);
}
timer()
{
string rn = llGetRegionName();
string lo = llKey2Name(llGetLandOwnerAt(llGetPos()));
if (lo == "")
{
lo = "Group Owned";
}
float di = llGetRegionTimeDilation();
integer fs = (integer) llGetRegionFPS();
vector la = llGetPos();
llSetText("Region: " + rn + " \n Land Owner: " + lo + "\n Dilation: " + (string) di + " \n FPS: " + (string) fs + "\n Position: " + (string) la,<1,0,.5>,1);
}
}
You'll notice I used a timer to refresh the data being collected, I find this the easiest way to do this. Under the timer event, I have all the floats, integers, strings, and varables declared. If I put these as global (befor default) they would NOT refresh, and be static.
Down to
string lo = llKey2Name(llGetLandOwnerAt(llGetPos()));
This took me a while to figure out on my own (call me a newby, go ahead), but that configuration returns the name of the property owner, at the position the object is at.
Right under it I stuck an If statment. I noticed if the land is group owned, the Key2Name will return a blank. So I desided to put something in there instead of leaving it blank.
The rest of the script is pretty self explanitory, once ya get to llSetText it may get a little confusing, but all I did was arange how I wanted the data to be displayed above the object.
After all's sayed and done, it should look like this when compiled, and ran.
