Honestly feel like a total noob posting here but I am having issues trying to get a parachute script to stop triggering a sound when it's being used. I've tried using "else if" function but I think I may be using it incorrectly. Any help on this would be awesome.
// Parachute script
// Applies a drag force in the Z-direction only,
// to change terminal velocity
// Ordinal Malaprop
// 2006-09-08
float gFallSpeed = 10.0;
float gCoefficient = 0.0;
default
{
state_entry()
{
llStopSound();
// Calculate drag coefficient based on desired speed
gCoefficient = 9.8 / (gFallSpeed * gFallSpeed);
// Correct drag force regularly
llSetTimerEvent(0.1);
llMessageLinked(LINK_SET, 40, "FlashOff", "");
llStopSound();
}
timer()
{
// Drag only applies in the Z-direction, and only downwards
vector vel = llGetVel();
float speed = vel.z;
if (speed > 15.0) speed = 0.0;
vector drag = llGetMass() * gCoefficient * speed * speed * <0.0, 0.0, 0.7>;
// Apply force
llSetForce(drag, 0);
llMessageLinked(LINK_SET, 40, "FlashOn", "");
llLoopSound("09b6c0cf-ce7f-e35f-34e8-dd6cb0a22e5d",1.0);
}
}