johnsamir
Advanced OT User
Lua:
--[[SevuEntertainment(c)]]--
local recAnimateText = false
local startSeconds = 20
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_MAGICWALL)
mwCountDownStart = function(position, seconds)
local spectators = Game.getSpectators(position, false, true, 7, 7, 7, 7)
if #spectators > 0 then
for _, spectator in ipairs(spectators) do
local animatedText = tostring(seconds)
Game.sendAnimatedText(animatedText, position, 180) --- color red here
end
end
if seconds > 0 then
addEvent(mwCountDownStart, 1000, position, seconds - 1)
end
end
function onCastSpell(creature, variant, isHotkey)
if combat:execute(creature, variant) then
mwCountDownStart(Variant.getPosition(variant), startSeconds)
return true
end
return false
end
up would be possible to add the name of the player that used the mwall in animated text too?
and maybe add multiple color like changing? you made an script a time ago that does that
a time ago @Mateus Robeerto
MADE THIS SCRIPT WHICH sen animated text in multilpe colors
Code:
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()