Log in

View Full Version : Need script to change weapon if target is ghost or Pirate Ghost



Dzonzi
08-25-2016, 08:14 PM
i want use fire sword

Elvang
08-25-2016, 10:21 PM
local specialMonsters = {"Ghost"}
local defaultWeapon = "Deepling Axe"
local specialWeapon = "Fire Axe"

Module("Weapon changer", function(self)
local c = Creature(Self.TargetID())
local useSpecial = c and table.find(specialMonsters, c:Name())
if useSpecial and Self.Weapon().id ~= specialWeapon then
Self.Equip(specialWeapon, "weapon")
elseif not useSpecial and Self.Weapon().id ~= defaultWeapon then
Self.Equip(defaultWeapon, "weapon")
end
self:Delay(1000)
end)