• 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!

Lua how to remove array [0] from my channel

darkmu

Well-Known Member
Joined
Aug 26, 2007
Messages
274
Solutions
1
Reaction score
50
Location
Paraná,Brazil
Every time I use "sendChannelMessage" it sends me like an array together, does anyone know how I can remove?

TFS 1.x

Lua:
local monsters = {"ferumbras mortal shell", "orshabaal", "ghazbaran", "gaz'haragoth"}

function onKill(creature, monster, target)
    local monsterName = monster:getName()
    if not isInArray(monsters, monsterName:lower()) then
        return true
    end
    
    local player = Player(creature)   
    
    temp = {playerId = 0, damage = 0}
    for currentPlayerId, currentDamage in pairs(monster:getDamageMap()) do
        local attackerPlayer = Player(currentPlayerId)
        if attackerPlayer then
            if temp.damage < currentDamage.total then
                temp.playerId = currentPlayerId
                temp.damage = currentDamage.total
            end
        end
    end
  
    if temp.playerId == 0 then
        return true
    end
    
    winnerPlayer = Player(temp.playerId)
    
    if not winnerPlayer then
        return true
    end
    
   sendChannelMessage(15, TALKTYPE_CHANNEL_O, "O jogador " .. winnerPlayer:getName() .. " deu o maior dano no Boss " .. monsterName .. " !!")
  
end

1612230861830.png
 
its not an array, but level zero, it is kind of a hack used to sendChannelMessage, and I don't think you can remove it without hexing your client (but I think it would also remove players level display)
 
Back
Top