haruspero Posted April 10, 2020 Share Posted April 10, 2020 I am attempting to make an overhead timer on an object. It's supposed to work in that as soon as the object is rezzed, the timer will show how many seconds until the object is deleted. I've been able to get it to say the seconds in the chat, but I want it to show as hovertext. Is this possible? Link to comment Share on other sites More sharing options...
Mollymews Posted April 10, 2020 Share Posted April 10, 2020 instead of llSay use llSetText http://wiki.secondlife.com/wiki/LlSetText Link to comment Share on other sites More sharing options...
Rolig Loon Posted April 10, 2020 Share Posted April 10, 2020 2 hours ago, Mollymews said: instead of llSay use llSetText http://wiki.secondlife.com/wiki/LlSetText In a timer event. Update the text each time the timer triggers. Link to comment Share on other sites More sharing options...
Badena Atheria Posted April 12, 2020 Share Posted April 12, 2020 (edited) Rez a prim, put this script in, and touch it integer counter; default { touch_start(integer total_number) { counter = 10; // chosen amount of living time in seconds llSetTimerEvent(1.0); // setting timer to the interval of a second } timer() { --counter; // counter preceded by 2x minus dashes llSetLinkPrimitiveParamsFast(0, [PRIM_TEXT, (string)counter + " sec", <1.0,1.0,1.0>, 1.0]); { llOwnerSay("KABOOOOUMMMMMmmmm....."); llDie(); } } } Edited April 12, 2020 by Badena Link to comment Share on other sites More sharing options...
Boopadoopdoop Posted April 28, 2020 Share Posted April 28, 2020 integer counter = 10; // chosen amount of living time in seconds. float CountDownSpeed = 1.0; // how fast to count down. DoText(string output) { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXT, output, <1.0,1.0,1.0>, 1.0]); // set text based on output } DoPayload() { llSleep(CountDownSpeed); // lol lazy sleep to keep the timing correct after it reaches zero DoText("KABOOM!!!!! lolzolz"); // send payload text to output. llResetScript(); //doing this instead of llDie for testing. lol //llDie(); } default { state_entry() //Can remove state entry if not using llResetScript, just here for example. { llSleep(CountDownSpeed); // lol lazy sleep DoText(""); // blank out text } touch_start(integer total_number) { llSetTimerEvent(CountDownSpeed); // setting timer to the interval of a second } timer() { DoText((string)counter-- + " seconds"); // send count text to output. if(counter < 0) { DoPayload(); // do payload. } } } Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now