Dzonzi
09-03-2016, 05:15 AM
I have this script
local Ring_RingID = 3051 -- id ring
local MonsterList = {"water elemental"}
local MonsterCount = 3 -- How many monsters until you equip the special ring?
local MonsterRange = 6 -- Range of the monsters until you equip the special ring?
Module.New("RingEquip", function(module)
local mob = Self.GetTargets(MonsterRange)
local mobCount = 0
for i = 1, #mob do
if table.contains(MonsterList, mob[i]:Name()) then
mobCount = mobCount + 1
end
end
if (mobCount >= MonsterCount and Self.Ring().id ~= Item.GetRingActiveID(Ring_RingID) and Self.ItemCount(Ring_RingID) > 0) then
Self.Equip(Ring_RingID, "ring")
elseif (mobCount < MonsterCount and Self.Ring().id == Item.GetRingActiveID(Ring_RingID)) then
Self.Dequip("ring", MainBackpack)
end
module:Delay(1000, 1100)
end)
but doesnt work. Can somebody help me?
local Ring_RingID = 3051 -- id ring
local MonsterList = {"water elemental"}
local MonsterCount = 3 -- How many monsters until you equip the special ring?
local MonsterRange = 6 -- Range of the monsters until you equip the special ring?
Module.New("RingEquip", function(module)
local mob = Self.GetTargets(MonsterRange)
local mobCount = 0
for i = 1, #mob do
if table.contains(MonsterList, mob[i]:Name()) then
mobCount = mobCount + 1
end
end
if (mobCount >= MonsterCount and Self.Ring().id ~= Item.GetRingActiveID(Ring_RingID) and Self.ItemCount(Ring_RingID) > 0) then
Self.Equip(Ring_RingID, "ring")
elseif (mobCount < MonsterCount and Self.Ring().id == Item.GetRingActiveID(Ring_RingID)) then
Self.Dequip("ring", MainBackpack)
end
module:Delay(1000, 1100)
end)
but doesnt work. Can somebody help me?