GTASkinCentral Posted July 16, 2014 Share Posted July 16, 2014 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 More sharing options...
Rolig Loon Posted July 16, 2014 Share Posted July 16, 2014 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. 1 Link to comment Share on other sites More sharing options...
GTASkinCentral Posted July 16, 2014 Author Share Posted July 16, 2014 Do you have any examples of one? I've been trying for ages haha! Can't get my head around object messages. And I would not need it to toggle, I want to have two buttons, one with on and one with off :matte-motes-grin: Link to comment Share on other sites More sharing options...
Rolig Loon Posted July 16, 2014 Share Posted July 16, 2014 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 More sharing options...
GTASkinCentral Posted July 16, 2014 Author Share Posted July 16, 2014 Thank you! I managed to in the end! Link to comment Share on other sites More sharing options...
Rolig Loon Posted July 16, 2014 Share Posted July 16, 2014 Fantastic! Congratulations. :smileywink: 1 Link to comment Share on other sites More sharing options...
Innula Zenovka Posted July 17, 2014 Share Posted July 17, 2014 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 More sharing options...
Qie Niangao Posted July 17, 2014 Share Posted July 17, 2014 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 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