Jump to content

Reivan

Resident
  • Posts

    6
  • Joined

  • Last visited

Reputation

1 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks, now works as intended.
  2. Hello i want to make hud with two buttons that show hide obiects wearing by avatar. Avatar have weared not linked two objects A and B, hud have two buttons A and B, when i click A button it shows A object and hide B object, When i click B button it shows B object and hide A object. I managed to make this hud button script: default { on_rez(integer rez) { if (!llGetAttached() ) llResetScript(); } state_entry() { llRequestPermissions( llGetOwner(), PERMISSION_ATTACH); } touch_start(integer total_number) { llRegionSay( -20,"off" ); } } And this object script: string ANIM = "animation"; integer an = 0; default { state_entry() { llListen(-20, "", NULL_KEY, ""); llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } listen(integer channel, string name, key id, string message) { if (llGetOwner() == llGetOwnerKey(id) ) { if(message == "off") { llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); llSetLinkAlpha(LINK_THIS, 0.0, ALL_SIDES); an=1; } if(message == "on") { llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); llSetLinkAlpha(LINK_THIS, 1.0, ALL_SIDES); an=0; } } } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { if (an) llStartAnimation(ANIM); else llStopAnimation(ANIM); } } } And it somehow work but with one problem, i tested it on my friend avatar and when i use hud my friend avatar is also controled, i spend couple of hours on this and nothing i tried works, anyone willing to help me with this making it to work only on owner avatar?
  3. Thanks, i try to figure it out, like i said im not a scripter, i can add sound or do other simple things but this one is black magic for me those scripts was writen by friend, he leaved SL long ago and i dont know any scripter to ask for help. If someone can write for me a basic working script to switch separate objects alphas with description what every line do then will be easier for me to understand how it works and modify my scripts, now i dont even understand what an = !an; is. It should look like that? integer CHANNEL = -6573; string SOUND = "sound"; string ANIM = "anim"; //------------------------------- integer an = 0; integer A = 1; integer B = 2; default { state_entry() { llListen(CHANNEL, "", NULL_KEY, ""); } touch_start(integer total_number) { if (llDetectedKey(0) == llGetOwner()) { llSetLinkAlpha(A, (float)an, ALL_SIDES); llSetLinkAlpha(B, (float)!an, ALL_SIDES); an = !an; llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); llStopSound(); llWhisper(CHANNEL, (string)llGetOwner()+"_change"); } } listen(integer channel, string name, key id, string message) { list mlist = llParseString2List(message,["_"],["_"]); if (message == "toggle" llList2String(mlist, 0) == (string)llGetOwner()) { an = !an; llSetLinkAlpha(A, (float)an, ALL_SIDES); llSetLinkAlpha(B, (float)!an, ALL_SIDES); llPlaySound(SOUND,1.0); llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { if (an) llStartAnimation(ANIM); else llStopAnimation(ANIM); } } on_rez(integer rr) { llResetScript(); } }
  4. It should look like this? integer CHANNEL = -6573; string SOUND = "sound"; string ANIM = "anim"; //------------------------------- integer an = 0; default { state_entry() { llListen(CHANNEL, "", NULL_KEY, ""); } touch_start(integer total_number) { if (llDetectedKey(0) == llGetOwner()) { llSetLinkAlpha(LINK_SET, 0, ALL_SIDES); an=0; llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); llStopSound(); llWhisper(CHANNEL, (string)llGetOwner()+"_change"); } } listen(integer channel, string name, key id, string message) { if (message=="hide") llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES); if (message=="show") llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES); llPlaySound(SOUND,1.0); an=1; llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { if (an) llStartAnimation(ANIM); else llStopAnimation(ANIM); } } on_rez(integer rr) { llResetScript(); } } This one does not work, also like i write above, it must be alpha switcher, one obiect must go alpha on command, another must show, and after use same or another chat command they switch back.
  5. Thank you for help , but i think i didnt described correctly my problem and what those scripts shoud be used, my bad sorry. Scripts are used as alpha switcher, i need it to switch an alpha betwen two unlinked weared obiects (weared on different body spots), and now it works on touching but those obiects will be in fast move so i must change it to chat command, and i need rework those scripts. Like i said im not an scripter so its hard for me.
  6. Hello i have a script to show/hide unlinked object but its work on touching and i need make it work on chat command, im not a scripter, tried do it by myself but my every attempt failed. Maybe someone will help me with that :) First script: integer CHANNEL = -6573; string SOUND = "sound"; string ANIM = "anim"; //------------------------------- integer an = 0; default { state_entry() { llListen(CHANNEL, "", NULL_KEY, ""); } touch_start(integer total_number) { if (llDetectedKey(0) == llGetOwner()) { llSetLinkAlpha(LINK_SET, 0, ALL_SIDES); an=0; llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); llStopSound(); llWhisper(CHANNEL, (string)llGetOwner()+"_change"); } } listen(integer channel, string name, key id, string message) { list mlist = llParseString2List(message,["_"],["_"]); if (llList2String(mlist, 0) == (string)llGetOwner()) { llSetLinkAlpha(LINK_SET, 1, ALL_SIDES); llPlaySound(SOUND,1.0); an=1; llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { if (an) llStartAnimation(ANIM); else llStopAnimation(ANIM); } } on_rez(integer rr) { llResetScript(); } } and second one: integer CHANNEL = -6573; string SOUND = "sound"; string ANIM = "anim"; //------------------------------- integer an = 0; default { state_entry() { llListen(CHANNEL, "", NULL_KEY, ""); an=1; llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } touch_start(integer total_number) { if (llDetectedKey(0) == llGetOwner()) { llSetLinkAlpha(LINK_SET, 0, ALL_SIDES); an=0; llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); llStopSound(); llWhisper(CHANNEL, (string)llGetOwner()+"_change"); } } listen(integer channel, string name, key id, string message) { list mlist = llParseString2List(message,["_"],["_"]); if (llList2String(mlist, 0) == (string)llGetOwner()) { llSetLinkAlpha(LINK_SET, 1, ALL_SIDES); llPlaySound(SOUND,1.0); an=1; llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); } } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { if (an) llStartAnimation(ANIM); else llStopAnimation(ANIM); } } on_rez(integer rr) { llResetScript(); } }
×
×
  • Create New...