local globalevent = GlobalEvent("positionandtext")
local textcolors = {5, 30, 35, 95, 108, 129, 143, 155, 180, 198, 210, 215}
local effects = {
{position = Position(32366, 32235, 7), text = 'Training Monks!', effect = CONST_ME_BATS},
--{position = Position(723, 594, 8), text = 'Treiner!', effect = CONST_ME_GIANTICE},
--{position = Position(305, 885, 8), text = 'Treinamento Offline!', effect = CONST_ME_BATS},
--{position = Position(2030, 481, 5), text = 'Skills Up!', effect = CONST_ME_BATS},
-- {position = Position(721, 593, 7), text = 'Clique!', effect = CONST_ME_GIANTICE},
}
function globalevent.onThink(interval)
for i = 1, #effects do
local settings = effects[i]
local spectators = Game.getSpectators(settings.position, false, true, 7, 7, 5, 5)
if #spectators > 0 then
if settings.text then
local textcolor = textcolors[math.random(#textcolors)]
Game.sendAnimatedText(settings.text, settings.position, textcolor)
end
if settings.effect then
settings.position:sendMagicEffect(settings.effect)
end
if settings.effect2 then
settings.position:sendMagicEffect(settings.effect2)
end
end
end
return true
end
globalevent:interval(2000)
globalevent:register()