• 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 Chance for a loot.

jestem pro

That is the question
Joined
Apr 20, 2013
Messages
650
Solutions
14
Reaction score
87
Hi everyone. I need a quickly help. I have this script"
Lua:
local rewardItems = {
    [1] = {2160,100},
    [2] = {2160,90},
    [3] = {2160,80},
    [4] = {2160,70},
    [5] = {2160,60}
}
function onDeath(cid, corpse, deathList)
    if not isMonster(cid) or #deathList == 0 then
        return true
    end

    local playerCount = 0
    for i = 1, #deathList do
        local playerCid = deathList[i]
        local chance = 80

        if isPlayer(playerCid) and chance >= math.random(100) then
            playerCount = math.min((playerCount+1), i)

            for k = 1, #rewardItems[playerCount] / 2 do
                doPlayerAddItem(playerCid, rewardItems[playerCount][k*2-1], rewardItems[playerCount][k*2])
                break
            end
           
        end
    end -- deathlist
   
    return true
end
The top 5 players get rewards and I want to add that other players than this 5 get only 100 cc.
Can someone help?

Version 0.3.6(8.6).
 
Last edited by a moderator:
Back
Top