Jump to content

Could someone help me with this script please?


Avenger20A

Recommended Posts

I'm trying to make a mod that applys a magic effect to handtohand. Here is the script so far.

 

***********************

scriptname MyH2HScript

 

float force

ref self

float angle

ref obj

 

Begin ScriptEffectStart

set self to getself

end

 

Begin ScriptEffectUpdate

if (player.IsAttacking == 1)

player.pushactoraway self 10

endif

End

 

Begin ScriptEffectFinish

End

***********************

 

Currently this is what happens. The spell is cast on player and lasts 10 seconds. When the player punches they are pushed away from themself.

 

What I want is when the player punches the target gets pushed away. I tried using GetCombatTarget but since the spell is cast on the player there is no CombatTarget. Does anyone Know how to fix this? Help?

Link to comment
Share on other sites

If the effect is on the player, self would be player, so the PushActorAway block would read more like "player.PushActorAway player 10". Unfortunately, the only way I can think of finding the punchee is to spam an AoE spell at the player's location that monitors anyone close to him for health damage. If they were just damaged, check if the player's attacking and his facing/location. (And whether the player has a weapon out or just Hand-to-Hand) If it's probable that they were hit by the player, push them away.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...