player.get_armor_ability

a.k.a. player.try_get_armor_ability

This function can be used to access a player's readied or holstered weapon.

When Bungie and 343i use this function, they often manually clear the object variable they are assigning to before calling the function. However, reverse-engineering of the game engine suggests that this is not actually necessary; the game will always properly return a value when this function is called.

This function returns object. Calling this function without storing its return value in a variable is an error.

Example

--
-- Don't allow players to use Armor Lock:
--
for each player do
   global.object[0] = current_player.get_armor_ability()
   if global.object[0].is_of_type(armor_lock) and global.object[0].is_in_use() then
      global.object[0].delete()
      game.show_message_to(current_player, none, "nope")
   end
end

Notes

See also