Skip to content

Why is this weapon not unequiping?

object oKiller = GetLastKiller();
object oWeapon = GetLastWeaponUsed(oKiller);
AssignCommand(oKiller, ActionUnequipItem(oWeapon));

Sure I am missing something simple.

Thank you for your time,

DJ-WoW

Comments

  • ProlericProleric Member Posts: 1,283
    edited January 2021
    According to the Lexicon, GetLastWeaponUsed is valid for the events OnPhysicalAttacked and OnUsed, whereas GetLastKiller is for the OnDeath event.

    I haven't verified this, but, ordinarily, functions defined for specific events generally don't work in other events.

    If your script is for the OnDeath event, you could use GetItemInSlot to identify oWeapon, as it isn't event-specific.
Sign In or Register to comment.