Ok here are parts of the script.
string ownerName;
integer switch;
integer COM_CHANNEL = -12345;
integer status;
string draw_command = "draw";
string sheath_command = "sheath";
ButtonPress()
{
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_SIZE, <0.01, 0.0775, 0.0775>]);
llTriggerSound("e6b5e02f-5d8a-831b-a951-0481981740b4",1);
llSleep(0.025);
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_SIZE, <0.01, 0.1000, 0.1000>]);
}
default
{
on_rez(integer params)
{
llStopSound();
llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES);
llSetLinkAlpha(1,0.0,ALL_SIDES);
ownerName = llKey2Name(llGetOwner());
}
state_entry()
{
llListen(COM_CHANNEL,"", NULL_KEY,"");
integer perm = llGetPermissions();
if (perm != (PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION))
}
touch_start(integer total_number)
{
ButtonPress();
if (switch==0)
{
switch=1;
llSay(COM_CHANNEL,"draw");
}
else if (switch==1)
{
switch=0;
llSay(COM_CHANNEL,"sheath");
}
}
attach(key on)
{
if (on != NULL_KEY)
{
integer perm = llGetPermissions();
}
}
listen( integer channel, string name, key id, string message )
{
if(llGetOwner() != llGetOwnerKey(id)) return;
if(message == draw_command)
{
weapon_show();
}
if(message == sheath_command)
{
weapon_hide();
}
}