Ir para conteúdo
  • 0

[Resolvido] HELP PLEASE Script não esta lendo o sqm do player ANIHI POKETIBIA


mister17

Pergunta

Ola tudo bem?

 

Inseri um script da anihi do tibia voltada para poketibia, porem não esta lendo a posição do player, então quando eu aperto alavanca fala que não tem um player na coordenada que eu selecionei, não sei o que fazer, alguém por gentileza em ajuda?

 

Abaixo  imagem da sala de teleport com o erro que não reconehce o sqm do player

Spoiler

image.thumb.png.40c7de828e809c110770d64cd44fc96c.png

 

 

 

Sala em que será teleportado

Spoiler

image.png.1a2b5284b52283ba17a4aeb38731687f.png

 

Editado por mister17
Link para o comentário
Compartilhar em outros sites

15 respostass a esta questão

Posts Recomendados

  • 0
Em 11/04/2019 em 12:51, mister17 disse:
Versão do Servidor: TFS - 0.3.5
Tipo de Script: actions
Código:
  Mostrar conteúdo oculto


local room = {     -- quest sala mega charizards
        fromX = 836,
        fromY = 1038,
        fromZ = 9,

 

        toX = 798,
        toY = 1032,
        toZ = 10,
        }

       local monster_pos = {
        [1] = {pos = {800, 1028, 10}, monster = "Mega Charizard Y"},
        [2] = {pos = {804, 1027, 10}, monster = "Mega Charizard X"},
        [3] = {pos = {808, 1027, 10}, monster = "Mega Charizard Y"},
        [4] = {pos = {812, 1028, 10}, monster = "Mega Charizard X"},
        [5] = {pos = {800, 1036, 10}, monster = "Mega Charizard Y"},
        [6] = {pos = {804, 1037, 10}, monster = "Mega Charizard X"},
	    [7] = {pos = {808, 1037, 10}, monster = "Mega Charizard Y"},
        [8] = {pos = {812, 1036, 10}, monster = "Mega Charizard X"},
		[9] = {pos = {830, 1016, 10}, monster = "Mega Charizard Y"},
        [10] = {pos = {831, 1019, 10}, monster = "Mega Charizard X"},
        [11] = {pos = {829, 1022, 10}, monster = "Mega Charizard Y"},
        [12] = {pos = {828, 1025, 10}, monster = "Mega Charizard X"},
        [13] = {pos = {826, 1028, 10}, monster = "Mega Charizard Y"},
        [14] = {pos = {824, 1029, 10}, monster = "Mega Charizard X"},
		[15] = {pos = {841, 1019, 10}, monster = "Mega Charizard Y"},
        [16] = {pos = {840, 1022, 10}, monster = "Mega Charizard X"},
		[17] = {pos = {840, 1027, 10}, monster = "Mega Charizard Y"},
        [18] = {pos = {839, 1029, 10}, monster = "Mega Charizard X"},
        [19] = {pos = {837, 1033, 10}, monster = "Mega Charizard Y"},
        [20] = {pos = {832, 1034, 10}, monster = "Mega Charizard X"},
		[21] = {pos = {831, 1037, 10}, monster = "Mega Charizard Y"},
        [22] = {pos = {829, 1039, 10}, monster = "Mega Charizard X"},
		[23] = {pos = {827, 1038, 10}, monster = "Mega Charizard Y"},
        [24] = {pos = {827, 1038, 10}, monster = "Mega Charizard X"}      
        }

        local players_pos = {
        {x = 837, y =1039, z = 9, stackpos = 253}
       -- {x = 1098, y =842, z = 7, stackpos = 253},
       -- {x = 1097, y =842, z = 7, stackpos = 253},
        --{x = 1096, y =842, z = 7, stackpos = 253}
        }

        local new_player_pos = {
        {x = 798, y = 1032, z = 10},
      --  {x = 1072, y = 810, z = 8},
       -- {x = 1071, y = 810, z = 8},
       -- {x = 1070, y = 810, z = 8}
        }

        local playersOnly = "yes"
        local questLevel = 8

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local all_ready, monsters, player, level = 0, 0, {}, 0
        if item.itemid == 1945 then
                for i = 1, #players_pos do
                        table.insert(player, 0)
                end
                for i = 1, #players_pos do
                        player = getThingfromPos(players_pos)
                        if player.itemid > 0 then
                                if string.lower(playersOnly) == "yes" then
                                        if isPlayer(player.uid) == TRUE then
                                                all_ready = all_ready+1
                                        else
                                                monsters = monsters+1
                                        end
                                else
                                        all_ready = all_ready+1
                                end
                        end
                end
                if all_ready == #players_pos then
                        for i = 1, #players_pos do
                                player = getThingfromPos(players_pos)
                                if isPlayer(player.uid) == TRUE then
                                        if getPlayerLevel(player.uid) >= questLevel then
                                                level = level+1
                                        end
                                else
                                        level = level+1
                                end
                        end
                        if level == #players_pos then
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
                                        for _, area in pairs(monster_pos) do
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
                                        end
                                        for i = 1, #players_pos do
                                                doSendMagicEffect(players_pos, CONST_ME_POFF)
                                                doTeleportThing(player.uid, new_player_pos, FALSE)
                                                doSendMagicEffect(new_player_pos, CONST_ME_ENERGYAREA)
                                                doTransformItem(item.uid,1946)
                                        end
                                else
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                                end
                        else
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                        end
                else
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
                end
        elseif item.itemid == 1946 then
                local player_room = 0
                for x = room.fromX, room.toX do
                        for y = room.fromY, room.toY do
                                for z = room.fromZ, room.toZ do
                                        local pos = {x=x, y=y, z=z,stackpos = 253}
                                        local thing = getThingfromPos(pos)
                                        if thing.itemid > 0 then
                                                if isPlayer(thing.uid) == TRUE then
                                                        player_room = player_room+1
                                                end
                                        end
                                end
                        end
                end
                if player_room >= 1 then
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")          
                elseif player_room == 0 then
                        for x = room.fromX, room.toX do
                                for y = room.fromY, room.toY do
                                        for z = room.fromZ, room.toZ do
                                                local pos = {x=x, y=y, z=z,stackpos = 253}
                                                local thing = getThingfromPos(pos)
                                                if thing.itemid > 0 then
                                                        doRemoveCreature(thing.uid)
                                                end
                                        end
                                end
                        end
                        doTransformItem(item.uid,1945)
                end
        end
        return TRUE
end

Ola tudo bem?

 

Inseri um script da anihi do tibia voltada para poketibia, porem não esta lendo a posição do player, então quando eu aperto alavanca fala que não tem um player na coordenada que eu selecionei, não sei o que fazer, alguém por gentileza em ajuda?

 

Abaixo  imagem da sala de teleport com o erro que não reconehce o sqm do player

  Mostrar conteúdo oculto

image.thumb.png.40c7de828e809c110770d64cd44fc96c.png

 

 

 

Sala em que será teleportado

  Mostrar conteúdo oculto

image.png.1a2b5284b52283ba17a4aeb38731687f.png

 

Isso é conta de ADM né? 

Testa com uma conta normal de player e ver se acontece o mesmo. 

Link para o comentário
Compartilhar em outros sites

  • 0
1 hora atrás, Ayron5 disse:

Isso é conta de ADM né? 

Testa com uma conta normal de player e ver se acontece o mesmo. 

Spoiler

image.png.c61f3c3d2266720668106b4d9bf23441.png

 

Continua o mesmo erro

 

Editado por mister17
Link para o comentário
Compartilhar em outros sites

  • 1
8 horas atrás, mister17 disse:

Nenhum erro de console, apenas não reconhece o sqm do player

Spoiler

local room = {     -- quest sala mega charizards
        fromX = 836,
        fromY = 1038,
        fromZ = 9,

 

        toX = 798,
        toY = 1032,
        toZ = 10,
        }

       local monster_pos = {
        [1] = {pos = {800, 1028, 10}, monster = "Mega Charizard Y"},
        [2] = {pos = {804, 1027, 10}, monster = "Mega Charizard X"},
        [3] = {pos = {808, 1027, 10}, monster = "Mega Charizard Y"},
        [4] = {pos = {812, 1028, 10}, monster = "Mega Charizard X"},
        [5] = {pos = {800, 1036, 10}, monster = "Mega Charizard Y"},
        [6] = {pos = {804, 1037, 10}, monster = "Mega Charizard X"},
	    [7] = {pos = {808, 1037, 10}, monster = "Mega Charizard Y"},
        [8] = {pos = {812, 1036, 10}, monster = "Mega Charizard X"},
		[9] = {pos = {830, 1016, 10}, monster = "Mega Charizard Y"},
        [10] = {pos = {831, 1019, 10}, monster = "Mega Charizard X"},
        [11] = {pos = {829, 1022, 10}, monster = "Mega Charizard Y"},
        [12] = {pos = {828, 1025, 10}, monster = "Mega Charizard X"},
        [13] = {pos = {826, 1028, 10}, monster = "Mega Charizard Y"},
        [14] = {pos = {824, 1029, 10}, monster = "Mega Charizard X"},
		[15] = {pos = {841, 1019, 10}, monster = "Mega Charizard Y"},
        [16] = {pos = {840, 1022, 10}, monster = "Mega Charizard X"},
		[17] = {pos = {840, 1027, 10}, monster = "Mega Charizard Y"},
        [18] = {pos = {839, 1029, 10}, monster = "Mega Charizard X"},
        [19] = {pos = {837, 1033, 10}, monster = "Mega Charizard Y"},
        [20] = {pos = {832, 1034, 10}, monster = "Mega Charizard X"},
		[21] = {pos = {831, 1037, 10}, monster = "Mega Charizard Y"},
        [22] = {pos = {829, 1039, 10}, monster = "Mega Charizard X"},
		[23] = {pos = {827, 1038, 10}, monster = "Mega Charizard Y"},
        [24] = {pos = {827, 1038, 10}, monster = "Mega Charizard X"}      
        }

        local players_pos = {
        {x = 837, y =1039, z = 9, stackpos = 253}
       -- {x = 1098, y =842, z = 7, stackpos = 253},
       -- {x = 1097, y =842, z = 7, stackpos = 253},
        --{x = 1096, y =842, z = 7, stackpos = 253}
        }

        local new_player_pos = {
        {x = 798, y = 1032, z = 10},
      --  {x = 1072, y = 810, z = 8},
       -- {x = 1071, y = 810, z = 8},
       -- {x = 1070, y = 810, z = 8}
        }

        local playersOnly = "yes"
        local questLevel = 8

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local all_ready, monsters, player, level = 0, 0, {}, 0
        if item.itemid == 1945 then
                for i = 1, #players_pos do
                        table.insert(player, 0)
                end
                for i = 1, #players_pos do
                        player[i] = getThingfromPos(players_pos[i])
                        if player.itemid > 0 then
                                if string.lower(playersOnly) == "yes" then
										if isPlayer(player[i].uid) == true then
                                                all_ready = all_ready+1
                                        else
                                                monsters = monsters+1
                                        end
                                else
                                        all_ready = all_ready+1
                                end
                        end
                end
                if all_ready == #players_pos then
                        for i = 1, #players_pos do
                                player[i] = getThingfromPos(players_pos[i])
                                if isPlayer(player.uid) == TRUE then
                                        if getPlayerLevel(player[i].uid) >= questLevel then
                                                level = level+1
                                        end
                                else
                                        level = level+1
                                end
                        end
                        if level == #players_pos then
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
                                        for _, area in pairs(monster_pos) do
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
                                        end
                                        for i = 1, #players_pos do
                                                doSendMagicEffect(players_pos[i], CONST_ME_POFF)
                                                doTeleportThing(player[i].uid, new_player_pos, FALSE)
                                                doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA)
                                                doTransformItem(item.uid,1946)
                                        end
                                else
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                                end
                        else
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                        end
                else
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
                end
        elseif item.itemid == 1946 then
                local player_room = 0
                for x = room.fromX, room.toX do
                        for y = room.fromY, room.toY do
                                for z = room.fromZ, room.toZ do
                                        local pos = {x=x, y=y, z=z,stackpos = 253}
                                        local thing = getThingfromPos(pos)
                                        if thing.itemid > 0 then
                                                if isPlayer(thing.uid) == TRUE then
                                                        player_room = player_room+1
                                                end
                                        end
                                end
                        end
                end
                if player_room >= 1 then
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")          
                elseif player_room == 0 then
                        for x = room.fromX, room.toX do
                                for y = room.fromY, room.toY do
                                        for z = room.fromZ, room.toZ do
                                                local pos = {x=x, y=y, z=z,stackpos = 253}
                                                local thing = getThingfromPos(pos)
                                                if thing.itemid > 0 then
                                                        doRemoveCreature(thing.uid)
                                                end
                                        end
                                end
                        end
                        doTransformItem(item.uid,1945)
                end
        end
        return TRUE
end

 

 

Link para o comentário
Compartilhar em outros sites

  • 0
6 minutos atrás, gabriel28 disse:
  Mostrar conteúdo oculto


local room = {     -- quest sala mega charizards
        fromX = 836,
        fromY = 1038,
        fromZ = 9,

 

        toX = 798,
        toY = 1032,
        toZ = 10,
        }

       local monster_pos = {
        [1] = {pos = {800, 1028, 10}, monster = "Mega Charizard Y"},
        [2] = {pos = {804, 1027, 10}, monster = "Mega Charizard X"},
        [3] = {pos = {808, 1027, 10}, monster = "Mega Charizard Y"},
        [4] = {pos = {812, 1028, 10}, monster = "Mega Charizard X"},
        [5] = {pos = {800, 1036, 10}, monster = "Mega Charizard Y"},
        [6] = {pos = {804, 1037, 10}, monster = "Mega Charizard X"},
	    [7] = {pos = {808, 1037, 10}, monster = "Mega Charizard Y"},
        [8] = {pos = {812, 1036, 10}, monster = "Mega Charizard X"},
		[9] = {pos = {830, 1016, 10}, monster = "Mega Charizard Y"},
        [10] = {pos = {831, 1019, 10}, monster = "Mega Charizard X"},
        [11] = {pos = {829, 1022, 10}, monster = "Mega Charizard Y"},
        [12] = {pos = {828, 1025, 10}, monster = "Mega Charizard X"},
        [13] = {pos = {826, 1028, 10}, monster = "Mega Charizard Y"},
        [14] = {pos = {824, 1029, 10}, monster = "Mega Charizard X"},
		[15] = {pos = {841, 1019, 10}, monster = "Mega Charizard Y"},
        [16] = {pos = {840, 1022, 10}, monster = "Mega Charizard X"},
		[17] = {pos = {840, 1027, 10}, monster = "Mega Charizard Y"},
        [18] = {pos = {839, 1029, 10}, monster = "Mega Charizard X"},
        [19] = {pos = {837, 1033, 10}, monster = "Mega Charizard Y"},
        [20] = {pos = {832, 1034, 10}, monster = "Mega Charizard X"},
		[21] = {pos = {831, 1037, 10}, monster = "Mega Charizard Y"},
        [22] = {pos = {829, 1039, 10}, monster = "Mega Charizard X"},
		[23] = {pos = {827, 1038, 10}, monster = "Mega Charizard Y"},
        [24] = {pos = {827, 1038, 10}, monster = "Mega Charizard X"}      
        }

        local players_pos = {
        {x = 837, y =1039, z = 9, stackpos = 253}
       -- {x = 1098, y =842, z = 7, stackpos = 253},
       -- {x = 1097, y =842, z = 7, stackpos = 253},
        --{x = 1096, y =842, z = 7, stackpos = 253}
        }

        local new_player_pos = {
        {x = 798, y = 1032, z = 10},
      --  {x = 1072, y = 810, z = 8},
       -- {x = 1071, y = 810, z = 8},
       -- {x = 1070, y = 810, z = 8}
        }

        local playersOnly = "yes"
        local questLevel = 8

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local all_ready, monsters, player, level = 0, 0, {}, 0
        if item.itemid == 1945 then
                for i = 1, #players_pos do
                        table.insert(player, 0)
                end
                for i = 1, #players_pos do
                        player[i] = getThingfromPos(players_pos[i])
                        if player.itemid > 0 then
                                if string.lower(playersOnly) == "yes" then
										if isPlayer(player[i].uid) == true then
                                                all_ready = all_ready+1
                                        else
                                                monsters = monsters+1
                                        end
                                else
                                        all_ready = all_ready+1
                                end
                        end
                end
                if all_ready == #players_pos then
                        for i = 1, #players_pos do
                                player[i] = getThingfromPos(players_pos[i])
                                if isPlayer(player.uid) == TRUE then
                                        if getPlayerLevel(player[i].uid) >= questLevel then
                                                level = level+1
                                        end
                                else
                                        level = level+1
                                end
                        end
                        if level == #players_pos then
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
                                        for _, area in pairs(monster_pos) do
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
                                        end
                                        for i = 1, #players_pos do
                                                doSendMagicEffect(players_pos[i], CONST_ME_POFF)
                                                doTeleportThing(player[i].uid, new_player_pos, FALSE)
                                                doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA)
                                                doTransformItem(item.uid,1946)
                                        end
                                else
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                                end
                        else
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                        end
                else
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
                end
        elseif item.itemid == 1946 then
                local player_room = 0
                for x = room.fromX, room.toX do
                        for y = room.fromY, room.toY do
                                for z = room.fromZ, room.toZ do
                                        local pos = {x=x, y=y, z=z,stackpos = 253}
                                        local thing = getThingfromPos(pos)
                                        if thing.itemid > 0 then
                                                if isPlayer(thing.uid) == TRUE then
                                                        player_room = player_room+1
                                                end
                                        end
                                end
                        end
                end
                if player_room >= 1 then
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")          
                elseif player_room == 0 then
                        for x = room.fromX, room.toX do
                                for y = room.fromY, room.toY do
                                        for z = room.fromZ, room.toZ do
                                                local pos = {x=x, y=y, z=z,stackpos = 253}
                                                local thing = getThingfromPos(pos)
                                                if thing.itemid > 0 then
                                                        doRemoveCreature(thing.uid)
                                                end
                                        end
                                end
                        end
                        doTransformItem(item.uid,1945)
                end
        end
        return TRUE
end

 

 

esta dando erro console agora na   linha 57

Spoiler

image.png.04d5c079065e8afefd28e99fe3ad2d46.png

 

Link para o comentário
Compartilhar em outros sites

  • 0
4 minutos atrás, gabriel28 disse:

Troca a linha 65 por isso:  if player.itemid > 0 then

mesmo erro linha 57 e um erro linha 65

 

Spoiler

image.png.3b93b53f21fc8a1e77962989f622b60e.png

 

Editado por mister17
Link para o comentário
Compartilhar em outros sites

  • 1
Agora, mister17 disse:

mesmo erro linha 57

Eu não sei o que tá rolando que quando comento, tá deletando uns caracteres, vou colar o script todo de novo.
Ai:
 

Spoiler

local room = {     -- quest sala mega charizards
        fromX = 836,
        fromY = 1038,
        fromZ = 9,

 

        toX = 798,
        toY = 1032,
        toZ = 10,
        }

       local monster_pos = {
        [1] = {pos = {800, 1028, 10}, monster = "Mega Charizard Y"},
        [2] = {pos = {804, 1027, 10}, monster = "Mega Charizard X"},
        [3] = {pos = {808, 1027, 10}, monster = "Mega Charizard Y"},
        [4] = {pos = {812, 1028, 10}, monster = "Mega Charizard X"},
        [5] = {pos = {800, 1036, 10}, monster = "Mega Charizard Y"},
        [6] = {pos = {804, 1037, 10}, monster = "Mega Charizard X"},
	    [7] = {pos = {808, 1037, 10}, monster = "Mega Charizard Y"},
        [8] = {pos = {812, 1036, 10}, monster = "Mega Charizard X"},
		[9] = {pos = {830, 1016, 10}, monster = "Mega Charizard Y"},
        [10] = {pos = {831, 1019, 10}, monster = "Mega Charizard X"},
        [11] = {pos = {829, 1022, 10}, monster = "Mega Charizard Y"},
        [12] = {pos = {828, 1025, 10}, monster = "Mega Charizard X"},
        [13] = {pos = {826, 1028, 10}, monster = "Mega Charizard Y"},
        [14] = {pos = {824, 1029, 10}, monster = "Mega Charizard X"},
		[15] = {pos = {841, 1019, 10}, monster = "Mega Charizard Y"},
        [16] = {pos = {840, 1022, 10}, monster = "Mega Charizard X"},
		[17] = {pos = {840, 1027, 10}, monster = "Mega Charizard Y"},
        [18] = {pos = {839, 1029, 10}, monster = "Mega Charizard X"},
        [19] = {pos = {837, 1033, 10}, monster = "Mega Charizard Y"},
        [20] = {pos = {832, 1034, 10}, monster = "Mega Charizard X"},
		[21] = {pos = {831, 1037, 10}, monster = "Mega Charizard Y"},
        [22] = {pos = {829, 1039, 10}, monster = "Mega Charizard X"},
		[23] = {pos = {827, 1038, 10}, monster = "Mega Charizard Y"},
        [24] = {pos = {827, 1038, 10}, monster = "Mega Charizard X"}      
        }

        local players_pos = {
        {x = 837, y =1039, z = 9, stackpos = 253}
       -- {x = 1098, y =842, z = 7, stackpos = 253},
       -- {x = 1097, y =842, z = 7, stackpos = 253},
        --{x = 1096, y =842, z = 7, stackpos = 253}
        }

        local new_player_pos = {
        {x = 798, y = 1032, z = 10},
      --  {x = 1072, y = 810, z = 8},
       -- {x = 1071, y = 810, z = 8},
       -- {x = 1070, y = 810, z = 8}
        }

        local playersOnly = "yes"
        local questLevel = 8

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local all_ready, monsters, player, level = 0, 0, {}, 0
        if item.itemid == 1945 then
                for i = 1, #players_pos do
                        table.insert(player, 0)
                end
                for i = 1, #players_pos do
                        player[i] = getThingfromPos(players_pos[i])
                        if player[i].itemid > 0 then
                                if string.lower(playersOnly) == "yes" then
										if isPlayer(player[i].uid) == true then
                                                all_ready = all_ready+1
                                        else
                                                monsters = monsters+1
                                        end
                                else
                                        all_ready = all_ready+1
                                end
                        end
                end
                if all_ready == #players_pos then
                        for i = 1, #players_pos do
                                player[i] = getThingfromPos(players_pos[i])
                                if isPlayer(player[i].uid) == TRUE then
                                        if getPlayerLevel(player[i].uid) >= questLevel then
                                                level = level+1
                                        end
                                else
                                        level = level+1
                                end
                        end
                        if level == #players_pos then
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
                                        for _, area in pairs(monster_pos) do
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
                                        end
                                        for i = 1, #players_pos do
                                                doSendMagicEffect(players_pos[i], CONST_ME_POFF)
                                                doTeleportThing(player[i].uid, new_player_pos, FALSE)
                                                doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA)
                                                doTransformItem(item.uid,1946)
                                        end
                                else
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                                end
                        else
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                        end
                else
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
                end
        elseif item.itemid == 1946 then
                local player_room = 0
                for x = room.fromX, room.toX do
                        for y = room.fromY, room.toY do
                                for z = room.fromZ, room.toZ do
                                        local pos = {x=x, y=y, z=z,stackpos = 253}
                                        local thing = getThingfromPos(pos)
                                        if thing.itemid > 0 then
                                                if isPlayer(thing.uid) == TRUE then
                                                        player_room = player_room+1
                                                end
                                        end
                                end
                        end
                end
                if player_room >= 1 then
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")          
                elseif player_room == 0 then
                        for x = room.fromX, room.toX do
                                for y = room.fromY, room.toY do
                                        for z = room.fromZ, room.toZ do
                                                local pos = {x=x, y=y, z=z,stackpos = 253}
                                                local thing = getThingfromPos(pos)
                                                if thing.itemid > 0 then
                                                        doRemoveCreature(thing.uid)
                                                end
                                        end
                                end
                        end
                        doTransformItem(item.uid,1945)
                end
        end
        return TRUE
end

 

 

Link para o comentário
Compartilhar em outros sites

  • 0
9 minutos atrás, gabriel28 disse:

Eu não sei o que tá rolando que quando comento, tá deletando uns caracteres, vou colar o script todo de novo.
Ai:
 

  Ocultar conteúdo


local room = {     -- quest sala mega charizards
        fromX = 836,
        fromY = 1038,
        fromZ = 9,

 

        toX = 798,
        toY = 1032,
        toZ = 10,
        }

       local monster_pos = {
        [1] = {pos = {800, 1028, 10}, monster = "Mega Charizard Y"},
        [2] = {pos = {804, 1027, 10}, monster = "Mega Charizard X"},
        [3] = {pos = {808, 1027, 10}, monster = "Mega Charizard Y"},
        [4] = {pos = {812, 1028, 10}, monster = "Mega Charizard X"},
        [5] = {pos = {800, 1036, 10}, monster = "Mega Charizard Y"},
        [6] = {pos = {804, 1037, 10}, monster = "Mega Charizard X"},
	    [7] = {pos = {808, 1037, 10}, monster = "Mega Charizard Y"},
        [8] = {pos = {812, 1036, 10}, monster = "Mega Charizard X"},
		[9] = {pos = {830, 1016, 10}, monster = "Mega Charizard Y"},
        [10] = {pos = {831, 1019, 10}, monster = "Mega Charizard X"},
        [11] = {pos = {829, 1022, 10}, monster = "Mega Charizard Y"},
        [12] = {pos = {828, 1025, 10}, monster = "Mega Charizard X"},
        [13] = {pos = {826, 1028, 10}, monster = "Mega Charizard Y"},
        [14] = {pos = {824, 1029, 10}, monster = "Mega Charizard X"},
		[15] = {pos = {841, 1019, 10}, monster = "Mega Charizard Y"},
        [16] = {pos = {840, 1022, 10}, monster = "Mega Charizard X"},
		[17] = {pos = {840, 1027, 10}, monster = "Mega Charizard Y"},
        [18] = {pos = {839, 1029, 10}, monster = "Mega Charizard X"},
        [19] = {pos = {837, 1033, 10}, monster = "Mega Charizard Y"},
        [20] = {pos = {832, 1034, 10}, monster = "Mega Charizard X"},
		[21] = {pos = {831, 1037, 10}, monster = "Mega Charizard Y"},
        [22] = {pos = {829, 1039, 10}, monster = "Mega Charizard X"},
		[23] = {pos = {827, 1038, 10}, monster = "Mega Charizard Y"},
        [24] = {pos = {827, 1038, 10}, monster = "Mega Charizard X"}      
        }

        local players_pos = {
        {x = 837, y =1039, z = 9, stackpos = 253}
       -- {x = 1098, y =842, z = 7, stackpos = 253},
       -- {x = 1097, y =842, z = 7, stackpos = 253},
        --{x = 1096, y =842, z = 7, stackpos = 253}
        }

        local new_player_pos = {
        {x = 798, y = 1032, z = 10},
      --  {x = 1072, y = 810, z = 8},
       -- {x = 1071, y = 810, z = 8},
       -- {x = 1070, y = 810, z = 8}
        }

        local playersOnly = "yes"
        local questLevel = 8

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local all_ready, monsters, player, level = 0, 0, {}, 0
        if item.itemid == 1945 then
                for i = 1, #players_pos do
                        table.insert(player, 0)
                end
                for i = 1, #players_pos do
                        player[i] = getThingfromPos(players_pos[i])
                        if player[i].itemid > 0 then
                                if string.lower(playersOnly) == "yes" then
										if isPlayer(player[i].uid) == true then
                                                all_ready = all_ready+1
                                        else
                                                monsters = monsters+1
                                        end
                                else
                                        all_ready = all_ready+1
                                end
                        end
                end
                if all_ready == #players_pos then
                        for i = 1, #players_pos do
                                player[i] = getThingfromPos(players_pos[i])
                                if isPlayer(player[i].uid) == TRUE then
                                        if getPlayerLevel(player[i].uid) >= questLevel then
                                                level = level+1
                                        end
                                else
                                        level = level+1
                                end
                        end
                        if level == #players_pos then
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
                                        for _, area in pairs(monster_pos) do
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
                                        end
                                        for i = 1, #players_pos do
                                                doSendMagicEffect(players_pos[i], CONST_ME_POFF)
                                                doTeleportThing(player[i].uid, new_player_pos, FALSE)
                                                doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA)
                                                doTransformItem(item.uid,1946)
                                        end
                                else
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                                end
                        else
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                        end
                else
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
                end
        elseif item.itemid == 1946 then
                local player_room = 0
                for x = room.fromX, room.toX do
                        for y = room.fromY, room.toY do
                                for z = room.fromZ, room.toZ do
                                        local pos = {x=x, y=y, z=z,stackpos = 253}
                                        local thing = getThingfromPos(pos)
                                        if thing.itemid > 0 then
                                                if isPlayer(thing.uid) == TRUE then
                                                        player_room = player_room+1
                                                end
                                        end
                                end
                        end
                end
                if player_room >= 1 then
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")          
                elseif player_room == 0 then
                        for x = room.fromX, room.toX do
                                for y = room.fromY, room.toY do
                                        for z = room.fromZ, room.toZ do
                                                local pos = {x=x, y=y, z=z,stackpos = 253}
                                                local thing = getThingfromPos(pos)
                                                if thing.itemid > 0 then
                                                        doRemoveCreature(thing.uid)
                                                end
                                        end
                                end
                        end
                        doTransformItem(item.uid,1945)
                end
        end
        return TRUE
end

 

 

Agora alavanca ja mexe antes não mexia porem ainda não esta teleportando sem erro console ele reconhece  o sqm do player falta só teleportar agora

Spoiler

image.png.c8f914a33014ddbd7f2eb505715fac1d.png

 

Editado por mister17
Link para o comentário
Compartilhar em outros sites

  • 1
14 minutos atrás, mister17 disse:

Agora alavanca ja mexe antes não mexia porem ainda não esta teleportando sem erro console

  Mostrar conteúdo oculto

image.png.c8f914a33014ddbd7f2eb505715fac1d.png

 

Tá complicado aqui, sempre que tento por uma tag de código, da lag.
 

Spoiler

Muda a linha 95 por isso: doTeleportThing(player.uid, new_player_pos, FALSE)

 

Link para o comentário
Compartilhar em outros sites

  • 0
5 minutos atrás, gabriel28 disse:

Tá complicado aqui, sempre que tento por uma tag de código, da lag.
 

  Ocultar conteúdo

Muda a linha 95 por isso: doTeleportThing(player.uid, new_player_pos, FALSE)

 

Agora ta dando um erro

 

[13/04/2019 17:27:41] [Error - Action Interface] 
[13/04/2019 17:27:41] data/actions/scripts/Basic/Quests/questcharizard.lua:onUse
[13/04/2019 17:27:41] Description: 
[13/04/2019 17:27:41] (luaDoTeleportThing) Thing not found

 

 

Link para o comentário
Compartilhar em outros sites

  • 1
1 hora atrás, mister17 disse:

Agora ta dando um erro

 

[13/04/2019 17:27:41] [Error - Action Interface] 
[13/04/2019 17:27:41] data/actions/scripts/Basic/Quests/questcharizard.lua:onUse
[13/04/2019 17:27:41] Description: 
[13/04/2019 17:27:41] (luaDoTeleportThing) Thing not found

 

 

O fórum tava travando e não consegui mandar antes. Fora que não tô conseguindo mandar a tag direito da forma que mandei, porque o fórum identifica [.i] pra por itálico na frase, mas enfim, mude a linha 95 por essa:
 

doTeleportThing(player[i].uid, new_player_pos[i], FALSE)

 

Link para o comentário
Compartilhar em outros sites

  • 0
5 minutos atrás, gabriel28 disse:

O fórum tava travando e não consegui mandar antes. Fora que não tô conseguindo mandar a tag direito da forma que mandei, porque o fórum identifica [.i] pra por itálico na frase, mas enfim, mude a linha 95 por essa:
 


doTeleportThing(player[i].uid, new_player_pos[i], FALSE)

 

Spoiler

image.thumb.png.45574a8b4581f3994f278e24589b6fa6.png

Muito Obrigado deu certinho você me ajudou a corrigir vários error do sript

Editado por mister17
Link para o comentário
Compartilhar em outros sites

  • 0
  • Diretor
A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...