Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onSay(cid, words, param)
- local table, config = {
- toClose = {[idportaaberta] = idportafechada}, -- Coloque aqui os ids das portas seguindo o exemplo, a segunda tabela vai ser criada sozinha
- toOpen = {}
- }, {
- fromPos = {x=x,y=y,z=z},
- toPos = {x=x,y=y,z=z}
- }
- for opened,closed in ipairs(table.toClose) do
- table.toOpen[closed] = opened
- end
- for x=config.fromPos.x, config.toPos.x do
- for y=config.fromPos.y, config.toPos.y do
- local doorPos = {x=x,y=y,z=config.fromPos.z}
- for stack=1,20 do
- doorPos.stackpos = stack
- for _,to in ipairs(table) do
- door = getThingFromPos(doorPos)
- if to[door.itemid] then
- doTransformThing(door.uid, to[door.itemid])
- end
- end
- end
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment