twogirlsonecup
02-15-2016, 04:30 AM
ive coded the script like this and for some reason it is not working?
i want the script to activate stealth rings when these creatures walk on screen,
if it helps i have a ring of the sky as a base ring to swap out but i cant seem to get it going.
any help will be much appreciated!
local RingID = 3049 --stealth ring
local amount = 1 -- monster amount to put ring on
local range = 6 -- range to consider when looking for monster on screen (NO MORE THAN 7!)
local monsterList =
{
'Cyclops',
'Cyclops Smith',
'Cyclops Drone',
'Scorpion',
'Orc Berserker',
}
**
function getMonsterCount2()
****local count = 0
****for k, v in ipairs(Self.GetTargets(range)) do
********if table.find(monsterList, v:Name()) then
************count = count + 1
********end
****end
****return count
end
**
function stealthring()
****if getMonsterCount2() >= amount and Self.Ring().id ~= getActiveRingID(RingID) and Self.ItemCount(RingID) >= 1 then
********Self.Equip(RingID, "ring")
****elseif getMonsterCount2() < 3 and Self.Ring().id == getActiveRingID(RingID) then
********Self.Dequip("ring")
****end
end
**
Module('StealthRing', function(stealth)
****stealthring()
stealth:Delay(200 * math.random(1,3))
end)
i want the script to activate stealth rings when these creatures walk on screen,
if it helps i have a ring of the sky as a base ring to swap out but i cant seem to get it going.
any help will be much appreciated!
local RingID = 3049 --stealth ring
local amount = 1 -- monster amount to put ring on
local range = 6 -- range to consider when looking for monster on screen (NO MORE THAN 7!)
local monsterList =
{
'Cyclops',
'Cyclops Smith',
'Cyclops Drone',
'Scorpion',
'Orc Berserker',
}
**
function getMonsterCount2()
****local count = 0
****for k, v in ipairs(Self.GetTargets(range)) do
********if table.find(monsterList, v:Name()) then
************count = count + 1
********end
****end
****return count
end
**
function stealthring()
****if getMonsterCount2() >= amount and Self.Ring().id ~= getActiveRingID(RingID) and Self.ItemCount(RingID) >= 1 then
********Self.Equip(RingID, "ring")
****elseif getMonsterCount2() < 3 and Self.Ring().id == getActiveRingID(RingID) then
********Self.Dequip("ring")
****end
end
**
Module('StealthRing', function(stealth)
****stealthring()
stealth:Delay(200 * math.random(1,3))
end)