marcos16
Falkhonn
- Joined
- May 4, 2012
- Messages
- 224
- Reaction score
- 1
Hello! I am using the following globalevents.
His duty is to summon a boss every x time, but he is with an error, he is summoning 4 boss.
I want you to try to summon only 1, and if that boss is already alive try another who is not and summon him ...
Thanks in advance.
Tfs 0.4.
His duty is to summon a boss every x time, but he is with an error, he is summoning 4 boss.
I want you to try to summon only 1, and if that boss is already alive try another who is not and summon him ...
Thanks in advance.
Tfs 0.4.
Code:
function onThink(interval, lastExecution)
local mName = 'none'
local pos = {x=0,y=0,z=0}
local dice = 1
local thing = 0
local certo = 1
local try = 5
while certo == 1 and try > 1 do
try = try -1
dice = math.random(4)
if dice == 1 then
mName = 'morgaroth'
pos = {x=980, y=866, z=12}
elseif dice == 2 then
mName = 'infernatil'
pos = {x=955, y=369, z=8}
elseif dice == 3 then
mName = 'apocalypse'
pos = {x=1651, y=615, z=12}
elseif dice == 4 then
mName = 'ferumbras'
pos = {x=331, y=390, z=8}
else
mName = 'Bazir
pos = {x=1387, y=1504, z=11}
end
thing = getCreatureByName(mName)
if thing == nil then
print('BOSS: '..mName)
doSummonCreature(mName, pos)
certo = 1
else
print('Already exist trying another')
end
end
return TRUE
end