• 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 little fix [SOLVED]

Wix

Banned User
Joined
Jan 3, 2021
Messages
29
Solutions
1
Reaction score
14
Location
Krypton
Edit i have used this thanks!
Lua:
local monsters = {
["demon"] = {item = 2160, count = 2, chance = 70},
["rat"] = {item = 2160, count = 2, chance = 80}
}   
 
function onKill(cid, target, lastHit)

local storage = 7474
local v = getMonsterInfo(getCreatureName(target)).lookCorpse
local chance = math.random(1, 100)
if getPlayerStorageValue(cid, storage) == 1 then
    for k, a in pairs(monsters) do
        if (isMonster(target) and ((string.lower(getCreatureName(target))) == k)) then
            if a.chance >= chance then
                local function dropLoot(pos, v, cid)
                    local corpse = getTileItemById(pos, v).uid
                    doAddContainerItem(corpse, a.item, math.random(1, a.count))
                end           
                addEvent(dropLoot, 0, getThingPos(target), v,cid)
            end
        end
    end
end
return true
end
 
Last edited:
Back
Top