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

death channel

ConAn Edujawa

Member
Joined
Feb 23, 2015
Messages
457
Reaction score
17
i have this script was work without error but now give me this error
KprD6ue.png


Code:
function onDeath(cid, corpse, deathList)
local strings = {""}
local t, position = 1, 1
local deathType = "killed"
local toSlain, toCrushed, toEliminated = 3, 9, 15
    if #deathList >= toSlain and #deathList < toCrushed then
        deathType = "slain"
    elseif #deathList >= toCrushed and #deathList < toEliminated then
        deathType = "crushed"
    elseif #deathList >= toEliminated then
        deathType = "eliminated"
    end
    for _, pid in ipairs(deathList) do
        if isCreature(pid) == true then
            strings[position] = t == 1 and "" or strings[position] .. " and "
            strings[position] = strings[position] .. getCreatureName(pid) .. ""
            t = t + 1
        else
            strings[position] = t == 1 and "" or strings[position] .. " and "
            strings[position] = strings[position] .."a field item"
            t = t + 1
        end
    end
    for i, str in ipairs(strings) do
        if(str:sub(str:len()) ~= " and") then
            str = str .. "."
        end
        msg = getCreatureName(cid) .. " was " .. deathType .. " at level " .. getPlayerLevel(cid) .. " by " .. str
    end
    for _, oid in ipairs(getPlayersOnline()) do
        doPlayerSendChannelMessage(oid, "Death channel", msg, TALKTYPE_CHANNEL_W, CHANNEL_DEATH)
    end
    return true
end


tfs 0.4

f5
 
Last edited by a moderator:
there's nothing lua-wise you can do here
the problem is your 0.4 doesn't have deathList for the onDeath function
you either need new sources or you need to compile the sources you have with changes to creatureevent.cpp
 
there's nothing lua-wise you can do here
the problem is your 0.4 doesn't have deathList for the onDeath function
you either need new sources or you need to compile the sources you have with changes to creatureevent.cpp

this script was work fine and than stop working and give me this error
 
if that's true then you clearly had to do something different
scripts don't just randomly stop working
what were you doing before the error
 
then i cant see how anyone will be able to help
"i don't do anything"
so you're telling me a script randomly broke from you doing absolutely nothing other than restarting?
 
Back
Top