Jump to content

Trying to script the sheath part for a katana


Vengeance Villota
 Share

You are about to reply to a thread that has been inactive for 4206 days.

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

Recommended Posts

So I have mostly everything else done for my Katana and one of the only thing holding me back from posting it on marketplace is this sheath issue I am having. I got it to disappear correctly when I draw the sword but it's not reappearing when I sheath it. Here's the script which I put in the part(s) I want to disappaer that I am using:

default
{
state_entry()
{
llListen(1,"",llGetOwner(),"");
}
on_rez(integer message) {
llResetScript();
}
listen(integer channel, string name, key id, string message) {
if(llToLower(message) == "draw")
llSetAlpha(0.0,ALL_SIDES);

if(llToLower(message) == "Sheath")
llSetAlpha(1.0,ALL_SIDES);
}


}

 

And another question. What line do I have to place in the melee script for it to only use the "stand" animation when holding the left mouse button? My swords go into "stand" right when they are drawn. If someone could IM me in game to discuss this that would be great. I bought the script and don't feel comfortable posting someone elses work here.

Link to comment
Share on other sites

That depends on what you want to delay.  In general, though, you write a timer event that contains the commands for whatever is supposed to happen when the timer fires.  Then you put a llSetTimerEvent statement at whatever point in your script you want to trigger the timer.  Take a look at http://wiki.secondlife.com/wiki/Timer

Link to comment
Share on other sites

actually I managed to figure this one out on my own :D.

 

default
{
state_entry()
{
llListen(1,"",llGetOwner(),"");
}
on_rez(integer message) {
llResetScript();
}
listen(integer channel, string name, key id, string message) {
if(llToLower(message) == "draw")
llSetAlpha(0.0,ALL_SIDES);

llSleep(1.5); // Side note: Sleep timer. This little command helps us keep the weapon shown for an amount of time before it's actually sheathing. Depends on your sheath animation and your sheath sound. If you do not need it, leave it on '0.0'

if(llToLower(message) == "sheath")
llSetAlpha(1.0,ALL_SIDES);


}


}

 

Thank you very much for the help. I've been working on this for a week sadly lol. I am very new to scripts.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4206 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
 Share

×
×
  • Create New...