If nothing else, you could certainly create a variable with a randomized value and use it to trigger user-defined functions. For example, you could write
integer num = (integer)llFrand(4.0);
if (num == 0)
{
function1();
}
else if (num == 1)
{
function2();
}
//and so forth....
It's not as compact and clean as what you can write in other languages that have a case or switch conditional function, but it works. If you want to follow up with further discussion, I suggest reposting your question in the LSL Scripting forum.
Question
Rolig Loon
If nothing else, you could certainly create a variable with a randomized value and use it to trigger user-defined functions. For example, you could write
integer num = (integer)llFrand(4.0);
if (num == 0)
{
function1();
}
else if (num == 1)
{
function2();
}
//and so forth....
It's not as compact and clean as what you can write in other languages that have a case or switch conditional function, but it works. If you want to follow up with further discussion, I suggest reposting your question in the LSL Scripting forum.
Link to comment
Share on other sites
2 answers to this question
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