Jump to content

Alpha Changer HUD?


GTASkinCentral
 Share

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

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

Recommended Posts

Hey!

 

How can I create a HUD which allows me to have two buttons, one to toggle alpha of an object to 1.0 and the other button toggles alpha of the same object to 0.0.

This also needs to be locked to the owner of the object only as it is for a clothing item's HUD and I dont want one person's HUD to be changing everyone else's items.

 

Thank you.

Alex!

Link to comment
Share on other sites

Write a simple On/Off script for your HUD that sends its signal to a script in the object you want to control.  In the script in your controlled object, listen for the message and set either llSetAlpha(1.0, ALL_SIDES) or llSetAlpha(0.0,ALL_SIDES) .  Unless you make the mistake of sending the message on a commonly-used public chat channel, your controlled object won't be likely to hear a command from anyone else.

BTW, you only need to have one button.  It's a toggle, after all.  Either ON or OFF.

  • Like 1
Link to comment
Share on other sites

You have chosen a very easy beginner script to work on.  I suggest spending a little time with basic LSL tutorials and then studying the wiki pages for llListen, llWhisper, llSetAlpha, and the listen event. When you have made some progress and still have specific questions, feel free to post your script here to get advcie about what to try next.

Link to comment
Share on other sites

One way to filter for messages coming from the object's owner (or from an object belonging to the owner) is:

 

listen(integer channel, string name, key id, string message)	{		if (llGetOwnerKey(id)==llGetOwner()){			//if the uuid of the owner of the object sending the message is that of my owner			//then the message is from an object belonging to my owner (or from my owner),			//so go ahead and process it					}	}

 

Link to comment
Share on other sites


GTASkinCentral wrote:

... it is for a clothing item's HUD...

If you want it to control that clothing item only while it is worn, you can reduce noise to other listeners by using llRegionSayTo() targeting the owner. That way, every script attached to that owner gets the message, and nothing else does.

(The listener should still check who is sending the messages it receives, but at least the messages your own script sends will go to only the intended recipient.)

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3569 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...