Ir para conteúdo

Featured Replies

Postado

Alguém poderia me ajudar, essa anihi modificada não está teleportando o player para x posição.. Ela não apresenta nenhum erro no distro, Mais na hora de dar use na alavanca ela da como se não tivesse players na posição inicial. Ao dar use na alavanca aparece a mensagem "Não tem 5 player necessarios"

 

local config = {

storage = 9721,

time = 120, --Tempo para fazer a quest, em minutos.

interval = 2, --Tempo para poder usar a alavanca novamente, em minutos.

timerPos = {

{x = 1127, y = 1152, z = 7}, --Posições onde o tempo restante aparecerá.

{x = 1129, y = 1150, z = 8},

{x = 1129, y = 1156, z = 8},

{x = 1121, y = 1150, z = 8},

{x = 1121, y = 1156, z = 8},

},

monster = {

name = "Demon", --Nome do monstro.

pos = {

{x = 1434, y = 822, z = 7}, --Posições onde ele vai nascer.

{x = 1434, y = 824, z = 7},

{x = 1434, y = 826, z = 7},

{x = 1442, y = 822, z = 7},

{x = 1442, y = 824, z = 7},

{x = 1442, y = 826, z = 7},

},

},

player = {

{{x = 1427, y = 824, z = 7}, {x = 1440, y = 824, z = 7}}, --{{posição onde o player deve ficar}, {para onde será teleportado}},

{{x = 1426, y = 824, z = 7}, {x = 1439, y = 824, z = 7}},

{{x = 1425, y = 824, z = 7}, {x = 1438, y = 824, z = 7}},

{{x = 1414, y = 824, z = 7}, {x = 1437, y = 824, z = 7}},

{{x = 1423, y = 824, z = 7}, {x = 1436, y = 824, z = 7}},

},

area = {{x = 1433, y = 820, z = 7}, {x = 1433, y = 828, z = 7}}, --{{posição superior esquerda da área}, {posição inferior direita da área}},

}

local cidPos = {}

function clearArea()

for x = config.area[1].x, config.area[2].x do

for y = config.area[1].y, config.area[2].y do

local pos = {x = x, y = y, z = config.area[1].z}

local pid = getTopCreature(pos).uid

if pid > 0 then

if isPlayer(pid) then

doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))

doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_RED, "Você não conseguiu completar a Quest.")

else

doRemoveCreature(pid)

end

end

end

end

setGlobalStorageValue(config.storage, os.time() + config.interval * 60)

end

function checkPlayer()

for x = config.area[1].x, config.area[2].x do

for y = config.area[1].y, config.area[2].y do

local pos = {x = x, y = y, z = config.area[1].z}

local pid = getTopCreature(pos).uid

if isPlayer(pid) then

return true

end

end

end

return false

end

function convert(time)

for i = 1, #config.timerPos do

doSendAnimatedText(config.timerPos, convert(time).minutes..":"..convert(time).seconds, 215)

end

end

function timer(time)

if time < 0 or not checkPlayer() then

return true

end

doSendAnimatedText(config.timerPos, convert(time).minutes..":"..convert(time).seconds, 215)

addEvent(timer, 1000, time - 1)

end

function onUse(cid)

if getGlobalStorageValue(config.storage) > os.time() then

return doPlayerSendCancel(cid, "Wait "..convert(getGlobalStorageValue(config.storage) - os.time()).minutes.."min and "..convert(getGlobalStorageValue(config.storage) - os.time()).seconds.."secs.")

elseif checkPlayer() then

return doPlayerSendCancel(cid, "Tem Player fazendo a Quest,Aguarde!.")

end

local p = {}

for _, pos in pairs(config.player) do

local pid = getTopCreature(pos[1]).uid

if isPlayer(pid) then

p[#p + 1] = pid

cidPos[pid] = _

end

end

if #p < #config.player then

return doPlayerSendCancel(cid, "Não tem 5 Player necessarios.")

end

for i = 1, #p do

doTeleportThing(p, config.player[cidPos[p]][2])

doPlayerSendTextMessage(p, 27, "Boa sorte!")

end

for _, pos in pairs(config.monster.pos) do

doCreateMonster(config.monster.name, pos)

end

timer(config.time)

addEvent(function()

clearArea()

end, config.time * 60 * 1000)

return true

end

  • Respostas 5
  • Visualizações 307
  • Created
  • Última resposta

Top Posters In This Topic

Postado

Verifique as posições nessa tabela do seu script, ve se as posições da frente em cada linha bate com o sqm onde os players devem estar no mapa para a alavanca funcionar:

player = {

{{x = 1427, y = 824, z = 7}, {x = 1440, y = 824, z = 7}}, --{{posição onde o player deve ficar}, {para onde será teleportado}},

{{x = 1426, y = 824, z = 7}, {x = 1439, y = 824, z = 7}},

{{x = 1425, y = 824, z = 7}, {x = 1438, y = 824, z = 7}},

{{x = 1414, y = 824, z = 7}, {x = 1437, y = 824, z = 7}},

{{x = 1423, y = 824, z = 7}, {x = 1436, y = 824, z = 7}},

},

Te ajudei? Clique em  Gostei ! 

²²²d¬¬b²²²

 

 

"She's got a smile that it seems to me...."  ♪♪

Postado
  • Autor

luangop, tive um pequeno erro ao configurar as posições mais agora aparece o seguinte erro:

 

[Error - Action interface]

data/actions/scripts/anihi.lua:onUse

Description:

data/actions/scripts/anihi.lua:183: attempt to index field '?' <anil value>

stack  traceback:

data/actions/scripts/anihi.lua:183: in function <data/actions/scripts/anihi.lua:147>

 

Postado
4 horas atrás, gabrielbuff disse:

luangop, tive um pequeno erro ao configurar as posições mais agora aparece o seguinte erro:

 

[Error - Action interface]

data/actions/scripts/anihi.lua:onUse

Description:

data/actions/scripts/anihi.lua:183: attempt to index field '?' <anil value>

stack  traceback:

data/actions/scripts/anihi.lua:183: in function <data/actions/scripts/anihi.lua:147>

 

Poste esse script data/actions/scripts/anihi.lua

Te ajudei? Clique em  Gostei ! 

²²²d¬¬b²²²

 

 

"She's got a smile that it seems to me...."  ♪♪

Postado
  • Autor

local config = {

storage = 9721,

time = 120, --Tempo para fazer a quest, em minutos.

interval = 2, --Tempo para poder usar a alavanca novamente, em minutos.

timerPos = {

{x = 1127, y = 1152, z = 7}, --Posições onde o tempo restante aparecerá.

{x = 1129, y = 1150, z = 8},

{x = 1129, y = 1156, z = 8},

{x = 1121, y = 1150, z = 8},

{x = 1121, y = 1156, z = 8},

},

monster = {

name = "Demon", --Nome do monstro.

pos = {

{x = 1434, y = 822, z = 7}, --Posições onde ele vai nascer.

{x = 1434, y = 824, z = 7},

{x = 1434, y = 826, z = 7},

{x = 1442, y = 822, z = 7},

{x = 1442, y = 824, z = 7},

{x = 1442, y = 826, z = 7},

},

},

player = {

{{x = 1427, y = 824, z = 7}, {x = 1440, y = 824, z = 7}}, --{{posição onde o player deve ficar}, {para onde será teleportado}},

{{x = 1426, y = 824, z = 7}, {x = 1439, y = 824, z = 7}},

{{x = 1425, y = 824, z = 7}, {x = 1438, y = 824, z = 7}},

{{x = 1414, y = 824, z = 7}, {x = 1437, y = 824, z = 7}},

{{x = 1423, y = 824, z = 7}, {x = 1436, y = 824, z = 7}},

},

area = {{x = 1433, y = 820, z = 7}, {x = 1433, y = 828, z = 7}}, --{{posição superior esquerda da área}, {posição inferior direita da área}},

}

local cidPos = {}

function clearArea()

for x = config.area[1].x, config.area[2].x do

for y = config.area[1].y, config.area[2].y do

local pos = {x = x, y = y, z = config.area[1].z}

local pid = getTopCreature(pos).uid

if pid > 0 then

if isPlayer(pid) then

doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))

doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_RED, "Você não conseguiu completar a Quest.")

else

doRemoveCreature(pid)

end

end

end

end

setGlobalStorageValue(config.storage, os.time() + config.interval * 60)

end

function checkPlayer()

for x = config.area[1].x, config.area[2].x do

for y = config.area[1].y, config.area[2].y do

local pos = {x = x, y = y, z = config.area[1].z}

local pid = getTopCreature(pos).uid

if isPlayer(pid) then

return true

end

end

end

return false

end

function convert(time)

for i = 1, #config.timerPos do

doSendAnimatedText(config.timerPos, convert(time).minutes..":"..convert(time).seconds, 215)

end

end

function timer(time)

if time < 0 or not checkPlayer() then

return true

end

doSendAnimatedText(config.timerPos, convert(time).minutes..":"..convert(time).seconds, 215)

addEvent(timer, 1000, time - 1)

end

function onUse(cid)

if getGlobalStorageValue(config.storage) > os.time() then

return doPlayerSendCancel(cid, "Wait "..convert(getGlobalStorageValue(config.storage) - os.time()).minutes.."min and "..convert(getGlobalStorageValue(config.storage) - os.time()).seconds.."secs.")

elseif checkPlayer() then

return doPlayerSendCancel(cid, "Tem Player fazendo a Quest,Aguarde!.")

end

local p = {}

for _, pos in pairs(config.player) do

local pid = getTopCreature(pos[1]).uid

if isPlayer(pid) then

p[#p + 1] = pid

cidPos[pid] = _

end

end

if #p < #config.player then

return doPlayerSendCancel(cid, "Não tem 5 Player necessarios.")

end

for i = 1, #p do

doTeleportThing(p, config.player[cidPos[p]][2])

doPlayerSendTextMessage(p, 27, "Boa sorte!")

end

for _, pos in pairs(config.monster.pos) do

doCreateMonster(config.monster.name, pos)

end

timer(config.time)

addEvent(function()

clearArea()

end, config.time * 60 * 1000)

return true

end

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo