silhouett Posted April 8, 2012 Share Posted April 8, 2012 (edited) I am trying to attach a script to an actor who's name is id is character2 and another actor whose name is Person2When either of them die I want to activate character1 or person1 respectively. I wrote this script and attached it to the actorsHow ever I think self may not work correctly here as they are not replaced ? Scriptname ZZDragondead extends ActorObjectReference Property Character1 AutoObjectReference Property Character2 AutoObjectReference Property Person1 AutoObjectReference Property Person2 Auto Event OnDeath(Actor akKiller) if Self == Character2 Character1.enable()if (akKiller == Game.GetPlayer())(Character1 as Actor).startcombat(game.getplayer())Debug.Trace("Character2 was killed by the player!")endif endIfif Self == Person2Person1.enable()if (akKiller == Game.GetPlayer())(Person1 as Actor).startcombat(game.getplayer())Debug.Trace("Person2 was killed by the player!")endif endIf endEvent Edited April 8, 2012 by silhouett Link to comment Share on other sites More sharing options...
Recommended Posts