function onAttack(cid, target)
local m = {
["rat"] = {
[xxxx] = {
useWeapon = "no" -- "yes" or "no"
}
},
["dog"] = {
[xxxx] = {
useWeapon = "no" -- "yes" or "no"
}
}
}
local monster = m[string.lower(getCreatureName(target))]
if not monster then
return true
end
local wep = getPlayerWeapon(cid, true)
if wep.itemid == 0 then
return true
end
local weapon = monster[wep.itemid]
local check = weapon.useWeapon
if check and not weapon then
return doCreatureSay(cid, "Sorry, you must be using a " .. getItemInfo(weapon).name .. " to attack this monster.", TALKTYPE_ORANGE_1, false, cid)
end
return true
end