Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function doRemoveItemByIdAndPos(itemid, pos, count) -- By Byerne XTibia
- local itempos, c = pos, 0
- for stackpos=1,255 do
- itempos.stackpos, i = stackpos, getThingFromPos(itempos)
- if i.itemid == itemid then
- doRemoveItem(i.uid, i.type)
- if (count and count == c) then
- break
- end
- end
- end
- end
- function onUse(cid, item, frompos, item2, topos) -- By Byerne XTibia
- local itempos, itemid, i, newpos = {x=000, y=000, z=0}, 1387, getThingfromPos(itempos), {x=000, y=000, z=0}
- if item.itemid == 1945 then
- doRemoveItemByIdAndPos(itemid, itempos)
- elseif item.itemid == 1946 then
- doCreateTeleport(itemid, newpos, itempos)
- end
- doTransformItem(item.uid,item.itemid == 1945 and 1946 or 1945)
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement