Jump to content
You are about to reply to a thread that has been inactive for 116 days.

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

Recommended Posts

Posted

Good afternoon, help me how to send a message from another object, that is, you need a script to send a message to this script that hides the object

 

//
// Copyright (c) 2016 ::jAS:: Fresh Script (a SecondLife user)
//
// This script by ::jAS: Fresh Script
//
// All rights reserved.


integer hidden;
integer channel = 911;

show()
{
integer numofprims = llGetNumberOfPrims() + 1;
integer i;
for(i=0;i<numofprims;i=i+1)
{
llSetLinkAlpha(i,1.0,ALL_SIDES);
}
hidden = FALSE;
}
hide()
{
integer numofprims = llGetNumberOfPrims() + 1;
integer i;
for(i=0;i<numofprims;i=i+1)
{
llSetLinkAlpha(i,0.0,ALL_SIDES);
}
hidden = TRUE;
}
default
{
state_entry()
{
hidden = FALSE;
show();
llListen(channel,"",llGetOwner(),"");
}
on_rez(integer num_detected)
{
llResetScript();
}
touch_start(integer total_number)
{
if(hidden == FALSE)
{
hide();
}
else if(hidden == TRUE)
{
show();
}
}
listen(integer channel, string name, key id, string message)
{
if(message == "hide")
{
hide();
}
else if(message == "show")
{
show();
}
}

Posted

No, actually because you've already assigned the listening channel in the script, all you need to do is type in chat either /911 show or /911 hide . You don't need another script to do that.  Also, because of the way the script is written you should be able to just touch the object to make it appear or disappear.  

  • Thanks 1
Posted (edited)
1 hour ago, Serjik81 said:

show()
{
integer numofprims = llGetNumberOfPrims() + 1;
integer i;
for(i=0;i<numofprims;i=i+1)
{
llSetLinkAlpha(i,1.0,ALL_SIDES);
}
hidden = FALSE;
}

can be replaced with:

show()
{   llSetLinkAlpha(LINK_SET,1.0,ALL_SIDES);
    hidden=FALSE;
}

and similarly for hide().

Edited by Quistess Alpha
  • Like 3
Posted

yes, it's all clear that I have to write in the chat or touch it, but I would like to make a button to add a script there that it was possible to do this from another object, so that another object would tell him via the 911 channel to hide or open

Posted

yes, I tried, I do not know why he does not listen, although everything works from the chat, you write / 911 to hide or show where there is probably an error, but come on, thanks for helping, I took the one that listens and added even from another in short, blinded from two and everything worked that's what happened

sumir()
{
integer num = llGetNumberOfPrims();
for(num;num >= 0;--num)
{
llSetLinkAlpha(num, 0.0 ,ALL_SIDES);
}
}

aparecer()
{
integer num = llGetNumberOfPrims();
for(num;num >= 0;--num)
{
llSetLinkAlpha(num, 1.0 ,ALL_SIDES);
}
}

default
{
state_entry()
{
llListen(911, "", NULL_KEY, "");
}

listen(integer channel, string name, key id, string message)
{
if (message == "show")
{
aparecer();
}
else if (message == "hide")
{
sumir();

}
}
}

Posted

in a transmitter like this to send

listen(integer channel,string name,key id,string message)
{
if (channel == menu_channel)
{
integer c_channel = 911;
if(message == "Rain On")
{
llShout(c_channel, "show");
}
else if(message == "Rain Off")
{
llShout(c_channel, "hide");
}

Posted
4 hours ago, Serjik81 said:

I do not know why he does not listen

search replace

16 hours ago, Serjik81 said:

llListen(channel,"",llGetOwner(),"");

which only listens to chat you type on your own with

llListen(channel,"","","");

  • Like 1
You are about to reply to a thread that has been inactive for 116 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
×
×
  • Create New...