OnCharacterDeath Funtions

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

OnCharacterDeath Funtions

Post by Noobasaurus »

I was looking at the docs and came across this, and it said:
CharacterDeath: function (player, killer).

How would I use this? I tried:

OnCharacterDeath(
function(player, killer))

but where would you put the outcome or what happens to the player or killer? To make it so the person who killed the other person got 75 sheild every time I tried:

OnCharacterDeath(
function(player, killer)
player, addsheild = "75")

but it didn't work. It seems that after further studying it applies to everyone when a unit is killed. How would you make it so when a player kills another player(AI or human) they get 75 shield?
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: OnCharacterDeath Funtions

Post by Marth8880 »

A typo... :o

You said "addsheild" when it SHOULD be "AddShield"...
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: OnCharacterDeath Funtions

Post by AQT »

You need to familiarize yourself with the following before you can even attempt this, as it seems you lack a basic foundation:
The last link is good for understanding the structure of similar functions.
Post Reply