Postado Março 7, 2015 10 anos Desculpa, às vezes eu sou uma legítima topeira. ;v Agora vai funcionar.. local playerPosition = { {x = 236, y = 294, z = 7, stackpos = STACKPOS_TOP_CREATURE}, {x = 235, y = 294, z = 7, stackpos = STACKPOS_TOP_CREATURE}, {x = 234, y = 294, z = 7, stackpos = STACKPOS_TOP_CREATURE}, {x = 233, y = 294, z = 7, stackpos = STACKPOS_TOP_CREATURE} } local newPosition = { {x=230, y=294, z=7}, {x=229, y=294, z=7}, {x=228, y=294, z=7}, {x=227, y=294, z=7} } local demonPosition = { {x=230, y=297, z=7}, {x=230, y=291, z=7}, {x=227, y=297, z=7}, {x=227, y=291, z=7}, {x=226, y=294, z=7}, {x=225, y=294, z=7} } function onUse(cid, item, fromPosition, itemEx, toPosition) local player = {0, 0, 0, 0} local failed = TRUE local count = 0 item.new = 1946 if(item.itemid == 1945) then if(os.time(t) >= (getGlobalStorageValue(9000) + 3600)) then for i = 1, 4 do player[i] = getThingfromPos(playerPosition[i]) if(player[i].itemid > 0) then if(isPlayer(player[i].uid) == TRUE) then if(getPlayerStorageValue(player[i].uid, 9000) <= 0) then if(getPlayerLevel(player[i].uid) >= 100 or getPlayerAccess(player[i].uid) >= 3) then failed = FALSE count = count + 1 elseif (getPlayerLevel(player[i].uid) <= 100) then doPlayerSendTextMessage(cid, 25, "Apenas level 100 ou mais podem fazer esta quest.") elseif (getPlayerStorageValue(player[i].uid, 9000) > 0) then doPlayerSendTextMessage(cid, 25, "Voce ja completou essa quest.") elseif (isPlayer(player[i].uid) == FALSE) then doPlayerSendTextMessage(cid, 25, "Voce so pode entrar com 4 players.") elseif (os.time(t) < (getGlobalStorageValue(9000) + 3600)) then doPlayerSendTextMessage(cid, 25, "A quest ja foi feita, volte em 1 hora.") end end end end if(failed == TRUE) then doTransformItem(item.uid, 1946) return TRUE end end if(count == 4) then for i = 1, 6 do doSummonCreature("Demon", demonPosition[i]) end for i = 1, 4 do doSendMagicEffect(playerPosition[i], CONST_ME_POFF) doTeleportThing(player[i].uid, newPosition[i], FALSE) doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA) setPlayerStorageValue(player[i].uid, 9000, 1) end setGlobalStorageValue(9000, os.time(t)) end end else item.new = 1945 end doTransformItem(item.uid, item.new) return TRUE end Ajudei? De nada \o/ Att Rusherzin
Postado Março 7, 2015 10 anos Autor Desculpa, às vezes eu sou uma legítima topeira. ;v Agora vai funcionar.. local playerPosition = { {x = 236, y = 294, z = 7, stackpos = STACKPOS_TOP_CREATURE}, {x = 235, y = 294, z = 7, stackpos = STACKPOS_TOP_CREATURE}, {x = 234, y = 294, z = 7, stackpos = STACKPOS_TOP_CREATURE}, {x = 233, y = 294, z = 7, stackpos = STACKPOS_TOP_CREATURE} } local newPosition = { {x=230, y=294, z=7}, {x=229, y=294, z=7}, {x=228, y=294, z=7}, {x=227, y=294, z=7} } local demonPosition = { {x=230, y=297, z=7}, {x=230, y=291, z=7}, {x=227, y=297, z=7}, {x=227, y=291, z=7}, {x=226, y=294, z=7}, {x=225, y=294, z=7} } function onUse(cid, item, fromPosition, itemEx, toPosition) local player = {0, 0, 0, 0} local failed = TRUE local count = 0 item.new = 1946 if(item.itemid == 1945) then if(os.time(t) >= (getGlobalStorageValue(9000) + 3600)) then for i = 1, 4 do player[i] = getThingfromPos(playerPosition[i]) if(player[i].itemid > 0) then if(isPlayer(player[i].uid) == TRUE) then if(getPlayerStorageValue(player[i].uid, 9000) <= 0) then if(getPlayerLevel(player[i].uid) >= 100 or getPlayerAccess(player[i].uid) >= 3) then failed = FALSE count = count + 1 elseif (getPlayerLevel(player[i].uid) <= 100) then doPlayerSendTextMessage(cid, 25, "Apenas level 100 ou mais podem fazer esta quest.") elseif (getPlayerStorageValue(player[i].uid, 9000) > 0) then doPlayerSendTextMessage(cid, 25, "Voce ja completou essa quest.") elseif (isPlayer(player[i].uid) == FALSE) then doPlayerSendTextMessage(cid, 25, "Voce so pode entrar com 4 players.") elseif (os.time(t) < (getGlobalStorageValue(9000) + 3600)) then doPlayerSendTextMessage(cid, 25, "A quest ja foi feita, volte em 1 hora.") end end end end if(failed == TRUE) then doTransformItem(item.uid, 1946) return TRUE end end if(count == 4) then for i = 1, 6 do doSummonCreature("Demon", demonPosition[i]) end for i = 1, 4 do doSendMagicEffect(playerPosition[i], CONST_ME_POFF) doTeleportThing(player[i].uid, newPosition[i], FALSE) doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA) setPlayerStorageValue(player[i].uid, 9000, 1) end setGlobalStorageValue(9000, os.time(t)) end end else item.new = 1945 end doTransformItem(item.uid, item.new) return TRUE end Agora não deu erro, porém não funcionou, nem mensagens, nem o script propriamente dito.
Postado Março 7, 2015 10 anos Solução Coloquei a parte de sumonar demons nesse aqui.. Tenta: local config = { daily = "no", -- allow only one enter per day? (like in global Tibia) level = 100, storage = 30015, entry = { {x = 247, y = 72, z = 7}, {x = 246, y = 72, z = 7}, {x = 245, y = 72, z = 7}, {x = 244, y = 72, z = 7} }, destination = { {x = 247, y = 76, z = 14}, {x = 246, y = 76, z = 14}, {x = 245, y = 76, z = 14}, {x = 244, y = 76, z = 14} }, demonPosition = { {x=498, y=753, z=10}, {x=500, y=753, z=10}, {x=499, y=757, z=10}, {x=497, y=757, z=10}, {x=502, y=755, z=10}, {x=501, y=755, z=10} } } config.daily = getBooleanFromString(config.daily) function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.itemid == 1946) then if(config.daily) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTransformItem(item.uid, item.itemid - 1) end return true end if(item.itemid ~= 1945) then return true end local players = {} for _, position in ipairs(config.entry) do local pid = getTopCreature(position).uid if(pid == 0 or not isPlayer(pid) or getCreatureStorage(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) return true end table.insert(players, pid) end for j = 1, 6 do doSummonCreature("Demon", config.demonPosition[j]) end for i, pid in ipairs(players) do doSendMagicEffect(config.entry[i], CONST_ME_POFF) doTeleportThing(pid, config.destination[i], false) doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA) end doTransformItem(item.uid, item.itemid + 1) return true end Ajudei? De nada \o/ Att Rusherzin
Postado Março 7, 2015 10 anos Autor Coloquei a parte de sumonar demons nesse aqui.. Tenta: local config = { daily = "no", -- allow only one enter per day? (like in global Tibia) level = 100, storage = 30015, entry = { {x = 247, y = 72, z = 7}, {x = 246, y = 72, z = 7}, {x = 245, y = 72, z = 7}, {x = 244, y = 72, z = 7} }, destination = { {x = 247, y = 76, z = 14}, {x = 246, y = 76, z = 14}, {x = 245, y = 76, z = 14}, {x = 244, y = 76, z = 14} }, demonPosition = { {x=498, y=753, z=10}, {x=500, y=753, z=10}, {x=499, y=757, z=10}, {x=497, y=757, z=10}, {x=502, y=755, z=10}, {x=501, y=755, z=10} } } config.daily = getBooleanFromString(config.daily) function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.itemid == 1946) then if(config.daily) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTransformItem(item.uid, item.itemid - 1) end return true end if(item.itemid ~= 1945) then return true end local players = {} for _, position in ipairs(config.entry) do local pid = getTopCreature(position).uid if(pid == 0 or not isPlayer(pid) or getCreatureStorage(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) return true end table.insert(players, pid) end for j = 1, 6 do doSummonCreature("Demon", config.demonPosition[j]) end for i, pid in ipairs(players) do doSendMagicEffect(config.entry[i], CONST_ME_POFF) doTeleportThing(pid, config.destination[i], false) doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA) end doTransformItem(item.uid, item.itemid + 1) return true end Funcionou direitinho, porém deu esse erro na questão "criação" do "demons"...
Postado Março 7, 2015 10 anos Configurou direito as posições? Aqui funcionou tudo direitinho.. Ajudei? De nada \o/ Att Rusherzin
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.