Sven Nebula Posted June 21, 2018 Share Posted June 21, 2018 (edited) Why isn't the touch script working? Please, I need help from a scripter ASAP. Here's the snippet: integer setting; float wait; float rand; default { state_entry() { @blink; llSetText((string)setting, <1, 1, 1>, 1); if(setting == 0) { llOffsetTexture(0, 0.2, -1); llOffsetTexture(0, 0.4, -1); wait = 0; rand = llFrand(0.2) + 0.1; while(wait < rand) { wait = wait + 0.25; llOffsetTexture(0, 0.4, -1); } llOffsetTexture(0, 0.2, -1); llOffsetTexture(0, 0, -1); wait = 0; rand = llFrand(8.0); while(wait < rand) { wait = wait + 0.25; llOffsetTexture(0, 0, -1); } } if(setting == 1) { llOffsetTexture(0, 0, -1); } if(setting == 2) { llOffsetTexture(0, 0.4, -1); } if(setting == 3) { llOffsetTexture(0, -0.1, -1); } if(setting == 4) { llOffsetTexture(0, 0.2, -1); } jump blink; } touch(integer total_number) { if(setting == 4) { setting = 0; } else { setting = setting + 1; } llOwnerSay((string)setting); } } Edited June 21, 2018 by JondiDitto Link to comment Share on other sites More sharing options...
Ruthven Ravenhurst Posted June 21, 2018 Share Posted June 21, 2018 It's because you have the jump in the state entry creating an infinite loop, and doesn't let it leave the event Link to comment Share on other sites More sharing options...
Sven Nebula Posted June 21, 2018 Author Share Posted June 21, 2018 13 minutes ago, Ruthven Willenov said: It's because you have the jump in the state entry creating an infinite loop, and doesn't let it leave the event Ah, so how would I do an infinite loop and let the script leave the state entry? Link to comment Share on other sites More sharing options...
animats Posted June 21, 2018 Share Posted June 21, 2018 See how to use a Timer. Basic concept in LSL: you do a little something to change your objects and exit. The world simulator then does lots of other things. Then you get another event, and another chance to change your objects a little. This repeats. There are scripting classes available at Oxbridge Caledon. 1 2 Link to comment Share on other sites More sharing options...
Sven Nebula Posted June 21, 2018 Author Share Posted June 21, 2018 13 minutes ago, animats said: See how to use a Timer. Basic concept in LSL: you do a little something to change your objects and exit. The world simulator then does lots of other things. Then you get another event, and another chance to change your objects a little. This repeats. There are scripting classes available at Oxbridge Caledon. Alright, I will check that out soon. If I run into any problems, I'll continue here. 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