DemocraticAlliance15 Posted July 6, 2013 Share Posted July 6, 2013 I am a bit stuck here an do not know what to do. I am trying to make a weapon that can heal NPC's when shot with it but it drains health from the Player. How would I go about doing this? I do not know much scripting so I am asking for some help. Link to comment Share on other sites More sharing options...
xiamthewalrusx Posted July 6, 2013 Share Posted July 6, 2013 (edited) EDIT: Sry, thought this was Skyrim :\ Edited July 6, 2013 by xiamthewalrusx Link to comment Share on other sites More sharing options...
Jojash Posted July 6, 2013 Share Posted July 6, 2013 The simplest way is to use an "OnFire" block, this will allow you to damage the player, with "Damage Actor Value Health", and restore the NPC's health using an "OnHit" block, "Restore Actor Value" and "GetOwnerLastTarget" (Sorry there's no link for this one, no-one's made the page for it. I'm happy to explain how to use it if you're unsure though!). Good luck! :) Link to comment Share on other sites More sharing options...
DemocraticAlliance15 Posted July 6, 2013 Author Share Posted July 6, 2013 The simplest way is to use an "OnFire" block, this will allow you to damage the player, with "Damage Actor Value Health", and restore the NPC's health using an "OnHit" block, "Restore Actor Value" and "GetOwnerLastTarget" (Sorry there's no link for this one, no-one's made the page for it. I'm happy to explain how to use it if you're unsure though!). Good luck! :smile:Yes can you explain what you said was complete chinese to me lol. Link to comment Share on other sites More sharing options...
Jojash Posted July 7, 2013 Share Posted July 7, 2013 Sure, Have you written any scripts before? Link to comment Share on other sites More sharing options...
jazzisparis Posted July 7, 2013 Share Posted July 7, 2013 Create a new script and use this code: scn HealingWeaponScript ref rTarget begin OnFire set rTarget to player.GetCombatTarget if rTarget rTarget.RestoreActorValue Health 10 player.DamageActorValue Health 10 endif end Then set your weapon to use this script. Link to comment Share on other sites More sharing options...
DemocraticAlliance15 Posted July 7, 2013 Author Share Posted July 7, 2013 Create a new script and use this code: scn HealingWeaponScript ref rTarget begin OnFire set rTarget to player.GetCombatTarget if rTarget rTarget.RestoreActorValue Health 10 player.DamageActorValue Health 10 endif end Then set your weapon to use this script. Is this an effect or object script? Link to comment Share on other sites More sharing options...
jazzisparis Posted July 7, 2013 Share Posted July 7, 2013 Object script. Link to comment Share on other sites More sharing options...
DemocraticAlliance15 Posted July 7, 2013 Author Share Posted July 7, 2013 Object script.Thanks for the help. I hope I can learn from this script so I can become better at scripting. Link to comment Share on other sites More sharing options...
Recommended Posts