Corporal Candour
Registered User
Join date: 3 Sep 2005
Posts: 38
|
01-19-2006 11:02
How do I make an object say something when it gets to a certain height above the ground? I'm looking for an object to say a message when it gets to 40 meters above ground level.
Thanks Corporal Candour
|
Zepp Zaftig
Unregistered Abuser
Join date: 20 Mar 2005
Posts: 470
|
01-19-2006 11:45
default { state_entry() { llSetTimerEvent(0.2); }
timer() { vector pos = llGetPos(); if(pos.z >= (llGround(ZERO_VECTOR) + 30)) { llSay(0, "Hello World!"); llSetTimerEvent(0); } } }
This would check every 0.2 sec to see if the object is 30m or higher above ground level and say "Hello World!" and stop checking when it reaches the target height.
|
Damien Took
Meat Popsicle
Join date: 3 Dec 2004
Posts: 151
|
01-19-2006 12:10
Try this: default { state_entry() { // Start the timer llSetTimerEvent(0.5); // Deacrease this if you want it to detect the height faster }
timer() { vector pos = llGetPos(); if (pos.z >= 40) { llSay(0, "My message here!"); } }
}
|