darkmu
Well-Known Member
Every time I use "sendChannelMessage" it sends me like an array together, does anyone know how I can remove?
TFS 1.x
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