antstubell Posted September 30, 2020 Share Posted September 30, 2020 (edited) So I'm using this script to damage the player when my exploding rat... explodes. Explosion PROPERTY MyBang auto ; explosion like fire attronach to show damageGlobalVariable Property SkBang AutoMessage PROPERTY MyMSG autoEVENT OnDying(Actor akKiller)IF (akKiller == Game.GetPlayer())myF_Action(akKiller)ENDIFENDEVENTFUNCTION myF_Action(Actor player);--------------------------------self.PlaceAtMe(MyBang) ; exlosion near of skeever corpseplayer.DamageActorValue("Health", 50) ; let the player damage by 50 hit pointsIf SkBang.GetValue() == 0MyMSG.show()SkBang.SetValue(1)EndifENDFUNCTION But other NPCs who kill the exploding rat take no damage. Is this script able to be modified to damage any NPC who kills a rat or is a new script needed?If a new script is needed I honestly don't know how to script it so that the explosion appears on the rat and damages the NPC. EDIT: Spell checker - femmage is a word? Edited September 30, 2020 by antstubell Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 30, 2020 Share Posted September 30, 2020 If this script is on the rat or an alias pointing to the rat just remove the condition check that akKiller be equal to the player. Run the function regardless of who kills the rat. i.e. Explosion PROPERTY MyBang auto ; explosion like fire attronach to show damage GlobalVariable Property SkBang Auto Message PROPERTY MyMSG auto EVENT OnDying(Actor akKiller) IF akKiller myF_Action(akKiller) ENDIF ENDEVENT FUNCTION myF_Action(Actor myKiller) ;-------------------------------- self.PlaceAtMe(MyBang) ; exlosion near of skeever corpse myKiller.DamageActorValue("Health", 50) ; let the killer be damaged by 50 hit points If SkBang.GetValue() == 0 MyMSG.show() SkBang.SetValue(1) Endif ENDFUNCTION Link to comment Share on other sites More sharing options...
maxarturo Posted September 30, 2020 Share Posted September 30, 2020 (edited) You don't need to use a script at all for this, i think you have fall into a "Only With Scripts Logic". Use only the explosion: 1) Make a unique explosion ID, and then just modify its "Force" and "Damage". OR 2) With the same unique explosion ID create a destruction "Enchantment" and assign it to the explosion, this way you have control of the damage that the "Enchantment" / explosion can or cannot be applied to. Edited September 30, 2020 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted October 1, 2020 Author Share Posted October 1, 2020 Thank you both. I went the scripted way. Link to comment Share on other sites More sharing options...
antstubell Posted October 3, 2020 Author Share Posted October 3, 2020 I should know this but my "WTF rats Explode!" don't attack NPCs. I have them on Predator Faction, What's appin'? Link to comment Share on other sites More sharing options...
Recommended Posts