Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local poses = {
- [1] = {pos={x = 1236, y = 475, z = 6, stackpos = 1}}, -- pierwsza wajcha
- [2] = {pos={x = 1239, y = 478, z = 6, stackpos = 1}}, -- druga wajcha
- [3] = {pos={x = 1239, y = 475, z = 6, stackpos = 1}}, -- trzecia wajcha
- [4] = {pos={x = 1236, y = 478, z = 6, stackpos = 1}} -- czwarta wajcha
- }
- local config = {
- key = 4901, -- storage
- newpos = {x = 9, y = 9, z = 9}, -- nie zmieniaj!
- createpos = {x = 1238, y = 480, z = 6}, -- pozycja do stworzenia teleportu
- }
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- local id = (item.itemid == 1945 and 1946 or 1945)
- doTransformItem(item.uid, id)
- if(item.actionid == 5001) then
- if(item.itemid == 1945 and getThingFromPos(poses[2].pos).itemid == 1945 and getThingFromPos(poses[3].pos).itemid == 1945 and getThingFromPos(poses[4].pos).itemid == 1945) then
- print ('a')
- return doPlayerSetStorageValue(cid, config.key, 1)
- end
- elseif(item.actionid == 5002) then
- if(item.itemid == 1945 and getThingFromPos(poses[1].pos).itemid == 1946 and getThingFromPos(poses[3].pos).itemid == 1945 and getThingFromPos(poses[4].pos).itemid == 1945) then
- print ('b')
- return doPlayerSetStorageValue(cid, config.key, getPlayerStorageValue(cid, config.key)+1)
- end
- elseif(item.actionid == 5003) then
- if(item.itemid == 1945 and getThingFromPos(poses[1].pos).itemid == 1946 and getThingFromPos(poses[2].pos).itemid == 1946 and getThingFromPos(poses[4].pos).itemid == 1945) then
- print ('c')
- return doPlayerSetStorageValue(cid, config.key, getPlayerStorageValue(cid, config.key)+1)
- end
- elseif(item.actionid == 5004) then
- if(item.itemid == 1945 and getThingFromPos(poses[1].pos).itemid == 1946 and getThingFromPos(poses[2].pos).itemid == 1946 and getThingFromPos(poses[3].pos).itemid == 1946) then
- print ('d')
- doPlayerSetStorageValue(cid, config.key, getPlayerStorageValue(cid, config.key)+1)
- if(getPlayerStorageValue(cid, config.key) == 4) then
- print ('f')
- doPlayerSetStorageValue(cid, config.key, 0)
- for i = 1, 4 do
- doTransformItem(getThingFromPos(poses[i].pos).uid, 1945)
- end
- print ('g')
- return doCreateTeleport(1387, config.newpos, config.createpos)
- end
- end
- end
- doPlayerSetStorageValue(cid, config.key, 0)
- return true
- end
Add Comment
Please, Sign In to add comment