Vidia Vargas Posted June 13, 2011 Share Posted June 13, 2011 Hello, maybe someone can help me with this. I have a weaponscript almost finished, i even have it to where when i draw a sword the bowsheaths and vice versa, the problem is i can only get it to work with chatcommands /1 draw sword etc... I want it so where when i use a hud that it doesthe sheath weapon switch as well. I have tested other weapon makers and theirhuds all sheath other weapons when drawing their own even if it’s not therecreating that they are sheathing.Example I have my own sword and then i have a Primus bow when idraw the primus bow through the Primus Hud my sword that i made sheaths... how doI do that. I know it’s possible but i can’t figure it out. Link to comment Share on other sites More sharing options...
Void Singer Posted June 13, 2011 Share Posted June 13, 2011 it depnds on the commands that each accepts... if you send a set of "sheath" commands whenever your weapon is drawn, all other weapons should treat it as a hud message and sheath. Link to comment Share on other sites More sharing options...
Innula Zenovka Posted June 13, 2011 Share Posted June 13, 2011 I don't know if this is the answer to the question, but one common "gotcha" when making things that need to respond both to the owner and the owner's hud is saying default{ state_entry() { llListen(99,"",llGetOwner(),""); } listen(integer channel, string name, key id, string message) { message = llToLower(message); if(message = "sheath"){ //do something } }} That doesn't work when the hud says "sheath" because, of course, the hud's uuid isn't the same as yours. Instead, you have to say something like key owner;//declare it as a global, because you don't need to check it all the timedefault{ state_entry() { llListen(99,"","",""); owner = llGetOwner(); } changed(integer change) { if (change & CHANGED_OWNER){ owner = llGetOwner(); } } listen(integer channel, string name, key id, string message) { if(llGetOwnerKey(id)==owner){//is it a message from my owner or something belonging to my owner? Avatars own themselves in according to LSL message = llToLower(message); if(message = "sheath"){ //do something } } }} That's going to work whether the command comes from the avatar or the avatar's hud. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now