Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pos = {
- -- amount of 'fromPosition' indexes must match the amount of 'toPosition'
- ['fromPosition'] = {
- {['x'] = 33331, ['y'] = 44444, ['z'] = 7},
- {['x'] = 33332, ['y'] = 44444, ['z'] = 7},
- {['x'] = 33333, ['y'] = 44444, ['z'] = 7},
- {['x'] = 33334, ['y'] = 44444, ['z'] = 7},
- {['x'] = 33335, ['y'] = 44444, ['z'] = 7},
- {['x'] = 33336, ['y'] = 44444, ['z'] = 7}
- },
- ['toPosition'] = {
- {['x'] = 33331, ['y'] = 44445, ['z'] = 7},
- {['x'] = 33332, ['y'] = 44445, ['z'] = 7},
- {['x'] = 33333, ['y'] = 44445, ['z'] = 7},
- {['x'] = 33334, ['y'] = 44445, ['z'] = 7},
- {['x'] = 33335, ['y'] = 44445, ['z'] = 7},
- {['x'] = 33336, ['y'] = 44445, ['z'] = 7}
- }
- }
- onUse = function(cid, item, fromPosition, itemEx, toPosition)
- if (item.id == 1945) then
- local players = #pos['toPosition']
- local store = {}
- for i = 1, players do
- local pid = getTopCreature(pos['fromPosition'][i]).uid
- if (pid == 0 or not isPlayer(pid)) then
- return doPlayerSendCancel(cid, 'You need ' .. players .. ' players to use the lever.')
- end
- store[i] = pid
- end
- for i = 1, players do
- doSendMagicEffect(pos['fromPosition'][i], CONST_ME_POFF)
- doTeleportThing(store[i], pos['toPosition'][i], false)
- doSendMagicEffect(pos['toPosition'][i], CONST_ME_TELEPORT)
- end
- return doTransformItem(item.uid, item.itemid + 1)
- elseif (item.id == 1946) then
- return doTransformItem(item.uid, item.itemid - 1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment