• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

animatedText Error!

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
Error:
Code:
[02/05/2014 18:07:08] [Error - GlobalEvent Interface]
[02/05/2014 18:07:08] data/globalevents/scripts/txt.lua:onThink
[02/05/2014 18:07:08] Description:
[02/05/2014 18:07:08] data/lib/050-function.lua:666: arg #2 in doSendAnimatedText is not a number
[02/05/2014 18:07:08] stack traceback:
[02/05/2014 18:07:08]    [C]: in function 'error'
[02/05/2014 18:07:08]    data/lib/050-function.lua:666: in function 'doSendAnimatedText'
[02/05/2014 18:07:08]    data/globalevents/scripts/txt.lua:12: in function <data/globalevents/scripts/txt.lua:1>
[02/05/2014 18:07:08] [Error - GlobalEvents::think] Couldn't execute event: txt

Script:
Code:
function onThink(cid, interval, lastExecution)
  local config = {positions = {
["Treiner and Hunt"] = {x=412, y=793, z=10},
["Treiner and Hunt"] = {x=566, y=926, z=7},
["Treiner and Hunt"] = {x=564, y=627, z=7},
["Venora"] = {x=330, y=856, z=7},
["Feldarin"] = {x=345, y=855, z=7},
["Bluffgard"] = {x=337, y=858, z=7},
["City"] = {x=566, y=932, z=10},
  }}
    for text, pos in pairs(config.positions) do
      doSendAnimatedText(pos, text, math.random(1, 256))
    end
  return true
end

Libs:
Code:
function doSendAnimatedText(pos, value, color, player)
    if(not tonumber(value))then
      return error("arg #2 in doSendAnimatedText is not a number")
    end
    if(isPlayer(player))then
      doPlayerSendTextMessage(player, MESSAGE_EXPERIENCE, "", pos, value, color)
    else
        for _, v in ipairs(getSpectators(pos, 7, 5, true)) do
            if(isPlayer(v))then
              doPlayerSendTextMessage(v, MESSAGE_EXPERIENCE, "", pos, value, color)
            end
        end
    end
end
 
Back
Top