Jump to content

Help with KillActor


Snake0391

Recommended Posts

I'm having trouble getting the KillActor function to work without crashing. I can get it to work in the game using the console, but when I call it in code the game just crashes. My code runs fine without it so I know it's just that piece of code that's making it crash. Here is my code:

 

scn aaBombStrap

ref Target
ref TargetAquired
short FoundEnemy
short Exploded
float Timer

Begin OnAdd

 Set Target to GetContainer
 if (Target != Player && Target != 0 && FoundEnemy != 1)
Set FoundEnemy to 1
Set TargetAquired to Target
 endif
End

Begin GameMode

 if (FoundEnemy == 1)
Set Timer to Timer + GetSecondsPassed
if (Timer > 10.00 && Exploded != 1)
  TargetAquired.PlaceAtMe LibertyPrimeNukeExplosion
  TargetAquired.KillActor Player 0 0
  Set Exploded to 1
endif
 endif
End

 

How do I make it work correctly? I just want to add a crime(the same as killing someone) to the player for using the bomb. Any help would be gladly appreciated.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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