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"
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).
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
Can someone help?
Version 0.3.6(8.6).
Last edited by a moderator: