Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

I'm searching for a script (wear object active object) ??!!

KaRoBelZ McMahon
Registered User
Join date: 14 Mar 2007
Posts: 27
10-25-2007 20:01
Hi!
I hope to explain it well :)
I'm looking for a script that can make an object wearable on my AV (like a prim) and active with /99something to do an action.

I know I'm not very clear.. but... if you wanna more info for answering my question it will be a pleasure for me to tell you more :)

Thank you in advance for your answers

KaRoBelZ
_____________________
Phoenix Ristow
Registered User
Join date: 11 Sep 2006
Posts: 9
10-29-2007 19:11
integer lChannel = 99;
integer Handle;

DoSomething()
{
//put what you want to occur in here
}
DoSomethingElse()
{
//put what you want to occur in here
}

default
{

state_entry()
{

}
attach(key attached)
{
if(attached!=NULL_KEY) //once the prim is being worn start listening on channel 99
{
Handle = llListen(lChannel,"",llGetOwner(),"";);
}
else
{
llListenRemove(Handle);
}
}

listen(integer channel, string name, key id, string message)
{
if(channel == lChannel) //did the owner say something on channel 99?
{
if(message == "oneCommand";) //did they say 'oneCommand'
{
DoSomething();
}

if(message == "aontherCommand";) //did they say 'anotherCommand'
{
DoSomethingElse();
}
}
}

//if you sell it make sure the new owner gets set

changed(integer change)
{
if(change & CHANGED_OWNER)
{
llResetScript();
}
}

}
KaRoBelZ McMahon
Registered User
Join date: 14 Mar 2007
Posts: 27
10-29-2007 19:36
Thank you

I'll try it :)
_____________________
Katryna Jie
Registered User
Join date: 24 Jun 2007
Posts: 187
10-29-2007 23:47
Ooooh interesting.. is it possible to attach to a particular part of the body? or just a general attach, based on the object's memory?
Daten Thielt
Registered User
Join date: 1 Dec 2006
Posts: 104
10-30-2007 11:45
u can attach it any where if u request attach permissiqons and then do

llAttachToAvatar(integer bodypart);

EG
llAttachToAvatar(ATTACH_HEAD);