Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local items = {
- [0] = {id = 2472, count = 1, chance = 2},
- [1] = {id = 2466, count = 1, chance = 5},
- [2] = {id = 8930, count = 1, chance = 10},
- [3] = {id = 8858, count = 1, chance = 15},
- [4] = {id = 2160, count = 10, chance = 30},
- [5] = {id = 6569, count = 50, chance = 100}
- }
- local table_pos = {x = 1012, y = 992, y = 7}
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- if itemEx.itemid == 2450 then
- if getTileItemById(table_pos, 2450).uid > 0 then
- for _ = 1, #items do
- if items[i].chance > math.random(1, 100) then
- doPlayerAddItem(cid, items[i].id, items[i].count)
- doPlayerSendTextMessage(cid, 26, "You make a: " .. getItemNameById(items[i].id) .. ".")
- break
- else
- doPlayerSendCancel(cid, "You make anything.")
- end
- else
- end
- else
- doPlayerSendCancel(cid, "Use in a table.")
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement