# Pearl Harbor Script

**URL:** https://forum.highend3d.com/t/pearl-harbor-script/6951
**Category:** Maya
**Tags:** mel
**Created:** [August 24, 2001, 7:41am UTC](https://forum.highend3d.com/t/pearl-harbor-script/6951 "2001-08-24T07:41:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mayaismygf](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@mayaismygf](https://forum.highend3d.com/u/mayaismygf)
#### Post date: [August 24, 2001, 7:41am UTC](https://forum.highend3d.com/t/pearl-harbor-script/6951/1 "2001-08-24T07:41:56Z")

</div>

I was reading in CineFX that they used a cool script on the ailerons and flaps for Pearl Harbor. It would check 10 frames ahead for the roll and adjust ailerons accordingly. So I'm trying to recreate something similar for my demo reel. I'm looking for any suggestions on the script - ways to streamline it. I'm fairly new to MEL and am sure there are redundancies and better ways to do this. Any help would be great..Thanks

------START SCRIPT--------  
cycleCheck -e off;  
int $magnitude;  
float $diff;  
float $currentbank;  
float $futurebank;  
int $advtime;  
$advtime = frame + 10;  
$currentbank = X\_248.rotateZ;  
$futurebank = `getAttr -t $advtime X\_248.rz`;  
$diff = (abs ($futurebank - $currentbank));  
if (($diff \> 1) && ($diff \< 5))  
 $magnitude = 1;  
else if (($diff \> 5) && ($diff \< 10))  
 $magnitude = 4;  
else if (($diff \> 10) && ($diff \< 15))  
 $magnitude = 7;  
else if ($diff \> 15)  
 $magnitude = 10;  
else  
 $magnitude = 0;  
if ($futurebank \> $currentbank)  
 setAttr X\_248.Ailerons $magnitude;  
else if ($futurebank \< $currentbank)  
 setAttr X\_248.Ailerons (-$magnitude);

---------END SCRIPT----------------
