Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: lonely_cubone on March 29, 2011, 11:47:22 pm

Title: [XP] Cannot Unequip Weapon
Post by: lonely_cubone on March 29, 2011, 11:47:22 pm
I was wondering if someone could please make a really quick script so that none of the actors can unequip their weapons. They can still switch between different weapons, but they always have some weapon equipped.

Thanks!
Title: Re: [XP] Cannot Unequip Weapon
Post by: ForeverZer0 on March 29, 2011, 11:56:35 pm
I think that this will work. I didn't actually try it, so let me know.

Spoiler: ShowHide

class Game_Actor
 
  alias no_unequip equip
  def equip(equip_type, id)
    if (equip_type == 0) && [nil, 0].include?(id)
      return
    end
    no_unequip(equip_type, id)
  end
end
Title: Re: [XP] Cannot Unequip Weapon
Post by: lonely_cubone on March 30, 2011, 09:18:12 am
Thanks, it works perfectly! :^_^':