09-09-2006 15:47
I have an item for my hand that rotates like a propeler....
Using llTargetOmega for it - and a dialoge box to turn it on and off.

The trouble im having is when you attatch the item - it refuses to start turning. It will start turning if you right click it and highlight it and release.

It needs some type of kickstart! But I havent found one that works.

CODE

list buttons = ["On", "Off"];

default
{
on_rez(integer start_params)
{
llResetScript();
}

state_entry()
{
llListen(-20, "",NULL_KEY, "");
}

touch_start(integer num_detected)
{
llDialog(llDetectedKey(0), "Turn on and off", buttons, -20);
}

listen(integer channel, string name, key id, string message)
{
if (llListFindList(buttons, [message]) != -1)
{
if (message == "On")
{
llSleep(0.3); // needed to kick start the Omega
llTargetOmega(<0,0,4>,PI,3.0);
}
if (message == "Off")
{
llTargetOmega(<0,0,0>,PI,3.0);
}

}
}
}


Anyone know a trick? Thanks!