Jump to content

Photo

HELP - Script Not Working

help script not working on death actor message box

  • Please log in to reply
3 replies to this topic

#1
Iconic985

Iconic985

    Regular

  • Members
  • PipPip
  • 80 posts

Hey Guys! I was working on a script that causes a message box to appear upon an actors death. Here is a script I found on the wiki:

Event OnDeath(Actor akKiller)
  if (akKiller == Game.GetPlayer())
    Debug.Trace("We were killed by the player!")
  endIf
endEvent

 

So in order to test this I applied it to an NPC in the creation kit via "Scripts" in the character creation menu however when I do kill the NPC nothing happens. Is this the right script? or am I using the wrong one? and if so what should I use?

 

Thanks in advance  :biggrin:

 



#2
blacksupernova

blacksupernova

    Fan

  • Members
  • PipPipPip
  • 451 posts

You were using the wrong function, you need to create a message in Messages branch of Miscellaneous tab and use Show function.



#3
Xander9009

Xander9009

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,340 posts

You could to that, but why not make it a notification, instead

. It'll be easier than making another object. (Please take into account that this is coming from someone who has done a fair amount of scripting BUT has NOT done anything with messages... at all.) If it were me, I'd replace "Debug.Trace" with "Debug.Notification".



#4
blacksupernova

blacksupernova

    Fan

  • Members
  • PipPipPip
  • 451 posts

You could to that, but why not make it a notification, instead

. It'll be easier than making another object. (Please take into account that this is coming from someone who has done a fair amount of scripting BUT has NOT done anything with messages... at all.) If it were me, I'd replace "Debug.Trace" with "Debug.Notification".

True, but the original poster said he wanted to "cause a message box to appear", message box won't appear with debug.notification







Also tagged with one or more of these keywords: help, script, not, working, on, death, actor, message, box

IPB skins by Skinbox
Page loaded in: 1.082 seconds