Zorkaz Posted January 30, 2020 Share Posted January 30, 2020 Does anyone know if there's a triggerbox that adds a poison or healing effect? Link to comment Share on other sites More sharing options...
Zorkaz Posted February 1, 2020 Author Share Posted February 1, 2020 Made my own script. For reference: Scriptname SBOutofBreathScript extends ObjectReference SPELL Property PoisonEffect Auto {The poison spell} Actor Property PlayerRef Auto {The player} Message Property TheMessagetoshow Auto {Show a message while being poisoned} Sound Property Coughingmale Auto Sound Property Coughingfemale Auto {Play a sound while being poisoned} ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Int InTrigger = 0 Event OnTriggerEnter(ObjectReference akTriggerRef) if (InTrigger == 0) if akTriggerRef == Game.GetPlayer() InTrigger += 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;While being in the trigger;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; while (InTrigger == 1) PoisonEffect.Cast(PlayerRef) TheMessagetoshow.Show() ActorBase PlayerBase = Game.GetPlayer().GetActorBase() Int Rand = Utility.RandomInt(0,100) ;This is so there's only one or two breath sounds not a thousand at once If Rand == 0 if (PlayerBase.GetSex() == 0) coughingmale.play(self) elseif (PlayerBase.GetSex() == 1) coughingfemale.play(self) Endif EndIf endwhile ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; endif endif EndEvent Event OnTriggerLeave(ObjectReference akTriggerRef) if (InTrigger > 0) if akTriggerRef == Game.GetPlayer() InTrigger -= 1 endif endif EndEvent Notes: As poison spell you might make your own spell with a custom damagehealth effect, that is flagged as "painless" Link to comment Share on other sites More sharing options...
Recommended Posts