Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onUse(cid, item, frompos, item2, topos)
- local positions, npcpos, books, countBooks, tableBooks = {}, {x=759,y=827,z=7,stackpos=1}, {10309, 10310, 10311, 10312, 10314, 10215}, 0, {}
- for x = 1,6 do
- table.insert(positions, {x=756+x,y=828,z=7,stackpos=1})
- end
- if item.itemid == 1945 then
- for i,pos in pairs(positions) do
- book = getThingFromPos(pos)
- if book.itemid == books[i] then
- table.insert(tableBooks, {pos, books[i]})
- countBooks = countBooks+1
- end
- end
- if countBooks == 6 then
- for _,value in pairs(tableBooks) do
- book = getThingFromPos(value[1])
- if book.itemid == value[2] then
- doRemoveItem(book.uid, 1)
- doTransformItem(item.uid,item.itemid+1)
- doCreateNpc('Shenron', npcpos)
- end
- end
- else
- doPlayerSendCancel(cid, "You need at least ".. 6-(countBooks).." books as sacrifice to summon Shenron.")
- end
- else
- doPlayerSendTextMessage(cid,22,"It doesn't seems to work.")
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement