Jump to content

How to Refer to self ????


silhouett

Recommended Posts

I am trying to attach a script to an actor who's name is id is character2 and another actor whose name is Person2

When either of them die I want to activate character1 or person1 respectively. I wrote this script and attached it to the actors

How ever I think self may not work correctly here as they are not replaced ?

Scriptname ZZDragondead extends Actor

ObjectReference Property Character1 Auto

ObjectReference Property Character2 Auto

ObjectReference Property Person1 Auto

ObjectReference 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

endIf

if Self == Person2

Person1.enable()

if (akKiller == Game.GetPlayer())

(Person1 as Actor).startcombat(game.getplayer())

Debug.Trace("Person2 was killed by the player!")

endif

endIf

endEvent

Edited by silhouett
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...