The OnDeath event doesnt work since its a objectreference script any one can help me on this?
ScriptName LevelingUpWeapon extends ObjectReference
int property xp auto
ObjectReference property LevelingUpWeapon01 auto
ObjectReference property LevelingUpWeapon02 auto
ObjectReference property LevelingUpWeapon03 auto
Event OnEquipped(Actor AkActor )
If akActor == Game.GetPlayer()
if (xp < 10)
Debug.notification("Level 1 Up Weapon Was Equiped")
elseif (xp >= 10) && (xp <25)
Debug.notification("Level 2 Up Weapon Was Equiped")
elseif (25 <= xp)
Debug.notification("Level 3 Up Weapon Was Equiped")
endIf
EndIf
EndEvent
Event OnDeath(Actor akKiller)
If (akKiller == game.getplayer())
Debug.Notification("You Killed An Enemy")
Debug.notification("Your Weapon Gained 1 xp")
xp += 1
if xp < 10
Game.GetPlayer().RemoveItem(LevelingUpWeapon01,1,true)
Game.GetPlayer().AddItem(LevelingUpWeapon02,1,true)
Game.GetPlayer().EquipItem(LevelingUpWeapon02,false,true)
elseif xp >= 25
Game.GetPlayer().RemoveItem(LevelingUpWeapon02,1,true)
Game.GetPlayer().AddItem(LevelingUpWeapon03,1,true)
Game.GetPlayer().EquipItem(LevelingUpWeapon03,false,true)
endif
Endif
EndEvent
Event OnUnEquipped(Actor AkActor )
If akActor == Game.GetPlayer()
if (xp < 10)
Debug.notification("Level 1 Up Weapon Was UnEquiped")
elseif (xp >= 10) && (xp <25)
Debug.notification("Level 2 Up Weapon Was UnEquiped")
elseif (25 <= xp)
Debug.notification("Level 3 Up Weapon Was UnEquiped")
endIf
EndIf
EndEvent