PeterTran Posted March 8, 2013 Share Posted March 8, 2013 I'm trying to create a mod, and within it I want to incorporate an effect that makes it so whenever I kill an enemy, I automatically heal an amount. I can't figure out how to do this, and any advice would be appreciated. Link to comment Share on other sites More sharing options...
StormWalker183 Posted March 8, 2013 Share Posted March 8, 2013 Scriptname HealonNPCDeath extends activemagiceffectActor Player = Game.GetPlayer()Event OnDeath(Actor akKiller) If(akKiller == Player) Player.ModActorValue("Health", 10) EndIfEndEvent (I'm relatively new to Papyrus, so if the OnDeath event is not the way to go, someone else please correct me.)Assuming, for the time being, I got it right, the above script is the most basic method, but won't scale with level. If you want to scale the health received with the character's level or health or any other aspect, I'll have to tell you to learn scripting yourself, because there are just too many different ways to set it up for me to write all of them. Link to comment Share on other sites More sharing options...
PeterTran Posted March 8, 2013 Author Share Posted March 8, 2013 Thanks, I'll experiment with that and see what I can come up with. I really appreciate it. Link to comment Share on other sites More sharing options...
PeterTran Posted March 8, 2013 Author Share Posted March 8, 2013 (edited) The script wouldn't compile, here's the output: Starting 1 compile threads for 1 files... Compiling "BerserkerHeal"... C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\BerserkerHeal.psc(3,15): no viable alternative at input 'Game' C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\BerserkerHeal.psc(3,19): required (...)+ loop did not match anything at input '.' C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\BerserkerHeal.psc(3,6): Unknown user flag Game No output generated for BerserkerHeal, compilation failed. I got the script to compile when using this: Scriptname BerserkerHeal extends activemagiceffect Event OnDeath(Actor akKiller) if(akKiller == Game.GetPlayer()) Game.GetPlayer().ModActorValue("Health", 1000) endif EndEvent But when I tried to use it in game, it wouldn't work. Edited March 8, 2013 by PeterTran Link to comment Share on other sites More sharing options...
Recommended Posts