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

Need help with script

Sparex

New Member
Joined
Jul 23, 2009
Messages
1
Reaction score
0
i need help this script should send text with loot of killed monsters and its does not work, no errors in console.

Lua:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
    local name = getCreatureName(cid)
    local text = ""
    if isPlayer(mostDamageKiller) == TRUE and isCreature(cid) == TRUE and getContainerItem(corpse.uid, 0).uid > 0 then
        local loot = {}
        for i = 1, getContainerSize(corpse.uid) do
            loot[i] = getContainerItem(corpse.uid, i-1)
        end
        for i, v in pairs(loot) do
            if text == "" then
                text = "Loot from "..name..": "..(v.type == 0 and getItemArticle(v.uid) or v.type).." "..getItemNameById(v.uid)
            else
                text = text..", "..(v.type == 0 and getItemArticle(v.uid) or v.type).." "..getItemNameById(v.uid)
            end
        end
        text = text.."."
    else
        text = "Loot from "..name..": Nothing."
    end
    doPlayerSendTextMessage(mostDamageKiller, MESSAGE_STATUS_CONSOLE_ORANGE, text)
    return TRUE
end
 
Back
Top