Jump to content

Help for a script


Fitzban
 Share

You are about to reply to a thread that has been inactive for 1237 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello guys!

I'm trying to write a script but it seems I'm way way too rusty and cannot even remember the basics right now and I would like to ask help to someone more experienced than me.

What I'm trying to do (with no success) is a scritp that makes an object clickable and that, once clicked, gives you a menu with 3 choices, randomly picked from a list (I was trying to link a notecard with the list of options to it) and state the one you picked in local chat.

Any clue about how I could do that? :D

thanks!

Link to comment
Share on other sites

Do it a step at a time, using the examples in the LSL Portal wiki,

Step 1 - look at the touch_start event and the functions such as llDetectedTouch... , this will get your object clickable. You will want to know the key of the person who touched it, which is llDetectedKey(total_number - 1).

Step 2 - look at llDialog and the listen event, this will show you examples of putting up a choice of buttons on a blue box for the toucher to click, and how the choice is received in the listen event. The dialog uses the key of the toucher, so that this person sees the blue box popup.

Step 3 - look at lists and llFRand, from which you will generate the random colours presented to the user in the llDialog function. You will need to be a bit clever here, keeping track of what you have already chosen to avoid adding the same colour twice. This is done by using a random number between 1 and list-entries - 1, but then checking if you have already chosen this colour; use llListFindList(buttons [random_choice]) to do this.

Keep versions of all the scripts as you develop them, each time to save a copy to your inventory before making new changes, rename the inventory copy with a 2 or 3 digit suffix. That way, when the new changes you make stop working, you can look at a version that was working and try to puzzle out why the changes you made didn't do what you thought they might.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1237 days.

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
 Share

×
×
  • Create New...