jordanit0 Posted August 27, 2014 Share Posted August 27, 2014 Hey everyone so I trying to get a HUD to work ive done the sender part and most of the reciever part this is what i got so far default { state_entry() { llListen(-1456465,"","",""); } listen(integer channel, string name, key id, string message){ //If owner do something if (llGetOwnerKey(id)==llGetOwner()){ if (message == "[BTN_1]"){ llSetAlpha(1.0, ALL_SIDES); } else llSay(0, "Unknown Request"); } } } Now i want to add another button to turn the alpha off and i thought it would be simple enough but i get an error when i add another if statement default { state_entry() { llListen(-1456465,"","",""); } listen(integer channel, string name, key id, string message){ //If owner do something if (llGetOwnerKey(id)==llGetOwner()){ if (message == "[BTN_1]"){ llSetAlpha(1.0, ALL_SIDES); if (message == "[BTN_2]"){ llSetAlpha (0.0, ALL_SIDES); } else llSay(0, "Unknown Request"); } } } Im a noob at this so any help would be great.Thanks Jordan Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted August 27, 2014 Share Posted August 27, 2014 You just forgot the closing curly backets } on the second if statement 1 Link to comment Share on other sites More sharing options...
jordanit0 Posted August 27, 2014 Author Share Posted August 27, 2014 Ah i knew it would be something simple thanks I got it to work now Link to comment Share on other sites More sharing options...
jordanit0 Posted August 27, 2014 Author Share Posted August 27, 2014 Sorry one last question. Is there a way to get the script to add and remove say a shoe base? If so could you point me in the right direction to look. Thanks jordan Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 27, 2014 Share Posted August 27, 2014 Not without using RLV. You can't put a script into system clothes the way you could in a prim or mesh skirt, for example, so there's no way to tell it to detach on command. Link to comment Share on other sites More sharing options...
jordanit0 Posted August 27, 2014 Author Share Posted August 27, 2014 Ah well there goes that idea lol thank you though Link to comment Share on other sites More sharing options...
jordanit0 Posted August 27, 2014 Author Share Posted August 27, 2014 Sorry me again now I have a problem when I click on the second button it doesn't work this is what im putting in button 1 default{ state_entry() { } touch_start(integer total_number) { llSay(-1456465, "[bTN_1]"); }} and button 2 default{ state_entry() { } touch_start(integer total_number) { llSay(-1456465, "[bTN_2]"); }} and in the object I want to switch the alpha on and off default{ state_entry() { llListen(-1456465,"","",""); } listen(integer channel, string name, key id, string message){ //If owner do something if (llGetOwnerKey(id)==llGetOwner()){ if (message == "[bTN_1]"){ llSetAlpha(1.0, ALL_SIDES); if (message == "[bNT_2]"){ llSetAlpha(0.0, ALL_SIDES); } else llSay(0, "Unknown Request"); } } }} Clicking on button 1 just gives unkown request. Do I need to have the buttons using different channels? Thanks Jordan Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 27, 2014 Share Posted August 27, 2014 Three suggestions: 1. Check to be sure that all Open brackets { are matched by closed brackets } (Yours aren't.) 2. Check all spelling. BNT != BTN. 3. Consider using llDetectedTouchST and a single texture instead of making separate scripted prim buttons. It's a MUCH better use of resources. 1 Link to comment Share on other sites More sharing options...
Innula Zenovka Posted August 27, 2014 Share Posted August 27, 2014 Your bracketing was wrong. Try this (I've also added an "else" to it, so that, if condition 1 is true, it doesn't bother to evaluate condition 2 (which must be false, if 1 is true); listen(integer channel, string name, key id, string message){ //If owner do something if (llGetOwnerKey(id)==llGetOwner()){ if (message == "[bTN_1]"){ llSetAlpha(1.0, ALL_SIDES); } else if (message == "[bTN_2]"){ llSetAlpha(0.0, ALL_SIDES); } else llSay(0, "Unknown Request"); } }//end of listen 1 Link to comment Share on other sites More sharing options...
jordanit0 Posted August 27, 2014 Author Share Posted August 27, 2014 Ah thank you both like i said noob here and your help is very much appreciated I'll have a look at that Rolig Hopefully I wont be back to pick your brains. I do stress hopefully lol Thanks again though 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