Dantarrix
Member
Well, I made this script a few days ago:
I try it with rabbit, it should give randomly, 1 to 10 cc and add them on rabbit's corpse, but it dont....
And it dont show any errors in console or crash or debug
If someone could help me please... :S
Code:
local monsters = {
["demon"] = {item = 2160, cant = 2, chance = 70},
["rat"] = {item = 2160, cant = 2, chance = 10},
["cyclops"] = {item = 2160, cant = 2, chance = 30},
["dragon"] = {item = 2160, cant = 2, chance = 55},
["rabbit"] = {item = 2160, cant = 10, chance = 100}
}
local percent = math.random(1, 100)
function onDeath(cid, corpse, deathList)
for k, v in pairs(monsters) do
if (isMonster(cid) and ((string.lower(getCreatureName(cid))) == k)) then
if percent <= v.chance then
doAddContainerItem(corpse.uid, v.item, math.random(1, v.cant))
doPlayerSendTextMessage(cid, 22, "You get special loot!")
end
end
end
return true
end
I try it with rabbit, it should give randomly, 1 to 10 cc and add them on rabbit's corpse, but it dont....
And it dont show any errors in console or crash or debug
If someone could help me please... :S