Avenger20A Posted August 31, 2008 Share Posted August 31, 2008 I'm trying to make a mod that applys a magic effect to handtohand. Here is the script so far. ***********************scriptname MyH2HScript float forceref selffloat angleref obj Begin ScriptEffectStart set self to getselfend Begin ScriptEffectUpdate if (player.IsAttacking == 1) player.pushactoraway self 10 endifEnd Begin ScriptEffectFinishEnd*********************** 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 More sharing options...
StryderOfOblivion Posted August 31, 2008 Share Posted August 31, 2008 player.pushactoraway self 10 Self might be your problem, I'm not sure though, haven't done much Weapon scripts. Try changing it to touch. ~Stryder~ Link to comment Share on other sites More sharing options...
LoginToDownload Posted August 31, 2008 Share Posted August 31, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.