Kawaki69
Member
- Joined
- Mar 4, 2022
- Messages
- 72
- Reaction score
- 8
Hi this script works but the reward message doesn't appear can some one help me to convert it to 1.4 thank you
Lua:
local items = {
[0] = {id = 10129, count = 1, chance = 9},
[1] = {id = 10128, count = 1, chance = 19},
[2] = {id = 2328, count = 1, chance = 22},
[3] = {id = 2195, count = 1, chance = 24},
[4] = {id = 2160, count = 10, chance = 31},
[5] = {id = 6569, count = 10, chance = 37}
}
function onUse(cid, item, fromPos, itemEx, toPos)
for i = 0, #items do
if (items[i].chance > math.random(1, 100)) then
doPlayerSetMaxCapacity(cid, getPlayerFreeCap(cid) + 100)
doPlayerAddItem(cid, items[i].id, items[i].count)
doRemoveItem(item.uid, 1)
doCreatureSay(cid, 'I congratulate you won item! This item is '..getItemNameById(items[i].id)..'!', TALKTYPE_MONSTER)
end
end
doRemoveItem(item.uid, 1)
doCreatureSay(cid, 'I congratulate you won item! This item is '..getItemNameById(items[i].id)..'!', TALKTYPE_MONSTER)
end