Begin adul_test_lookatme_b_scrshort doOnceif ( MenuMode == 1 ) Returnendifif ( "player"->GetSoundPlaying, "Weapon Swish" == 1 ) if ( doOnce == 0 ) StartScript, "adul_test_lookatme_scr" set doOnce to 1 endifelseif ( doOnce == 1 ) set doOnce to 0endifEndThis script checks every frame whether the player is swishing his weapon, and if he does, it runs the global script "adul_test_lookatme_scr". Right now it does not work with bows or crossbows but making changes to it to allow that wouldn't be too hard. The adul_test_lookatme_scr script is as follows:
Begin adul_test_lookatme_scrshort doOnceshort stemplong pcreflong tempif ( MenuMode == 1 ) Returnendifif ( doOnce == 0 ) "player"->AddSpell, "adul_test_lookatme_sp" set doOnce to 1 Returnendifsetx pcref to xGetRef, "player"xSetRef, pcrefset stemp to GetSpellEffects, "adul_test_lookatme_sp"if ( stemp == 0 ) Returnendifsetx temp to xGetPCTarget"player"->RemoveSpell, "adul_test_lookatme_sp"set doOnce to 0StopScript, "adul_test_lookatme_scr"if ( temp == 0 ) Returnendifsetx temp to temp->xGetBaseIDsetx temp to xStringCompare, temp, "adul_test_lookatme"if ( temp != 0 ) ReturnendifMessageBox, "Ouch!"EndThe spell "adul_test_lookatme_sp" is a 1000 point telekinesis spell that has the ability checkbox checked. Every time you swing your weapon, the spell gets added to you for 1 frame, and if you're looking in the direction of the barrel, the barrel will say "Ouch!"