2 horas atrás, Naruse disse:Ja Tentou
if getCreatureSummons >= 1 then ??
E so vc ler a linha
if (x == 0 or not getCreatureName(getCreatureSummons(x)[1] == POKEMON) then
doPlayerSendTextMessage(cid,22, "Sem pokemon")
return true
end
info
Grupo: Conde
Registrado: 21/04/16
Posts: 831
Reputação: +271
Gênero: Masculino

2 horas atrás, Naruse disse:Ja Tentou
if getCreatureSummons >= 1 then ??
E so vc ler a linha
if (x == 0 or not getCreatureName(getCreatureSummons(x)[1] == POKEMON) then
doPlayerSendTextMessage(cid,22, "Sem pokemon")
return true
end
Testa ai meu consagrado
--- By Marshmello and Crypter local function hasItems(cid, table) local has = {} for _, it in pairs(table) do if getPlayerItemCount(cid, it) > 0 then table.insert(has, it) end end return (#has == #table) end local t = { itens = {2142, 4852}, tempo = 86400,-- tempo de Espera level = 169, -- level necessário inicio = { -- posição inicial dos players -- {x = 1994, y = 1794, z = 5}, -- pos play 1 {x = 1995, y = 1794, z = 5}, -- pos play 2 -- {x = 1997, y = 1794, z = 5}, -- pos play 3 }, fim = { -- posição para onde os players irão -- {x = 942, y = 3773, z = 7}, {x = 940, y = 3773, z = 7}, -- {x = 941, y = 3773, z = 7}, } } function onUse(cid, item, fromPosition, itemEx, toPosition) local players = {} for _, k in ipairs(t.inicio) do local creatureOnPos = getTopCreature(k).uid if not (isCreature(creatureOnPos) and isPlayer(creatureOnPos)) then doPlayerSendTextMessage(cid,25, "Está faltando jogadores para entrar na missão, verifique se todos estão nos pisos corretos.") return true end if(getPlayerLevel(creatureOnPos) < t.level) then doPlayerSendTextMessage(cid,25, "O Jogador ".. getCreatureName(creatureOnPos) .." não tem o nível requirido para entrar na missão.") return true end if not hasItems(creatureOnPos, t.itens) then doPlayerSendTextMessage(cid,22, "O Jogador ".. getCreatureName(creatureOnPos) .." não tem os itens requiridos para entrar na missão.") return true end if not (#getCreatureSummons(creatureOnPos) >= 1) then doPlayerSendTextMessage(cid,22, "O Jogador ".. getCreatureName(creatureOnPos) .." não está com seu pokemon fora da pokebola.") return true end table.insert(players, creatureOnPos) end for i, pid in ipairs(players) do doSendMagicEffect(t.inicio, 2) doTeleportThing(pid, t.fim, false) doSendMagicEffect(t.fim, 10) setGlobalStorageValue(cid, 1115547, os.time() + t.tempo) end return true end
info
Grupo: Conde
Registrado: 21/04/16
Posts: 831
Reputação: +271
Gênero: Masculino

54 minutos atrás, Crypter disse:Testa ai meu consagrado
--- By Marshmello and Crypter local function hasItems(cid, table) local has = {} for _, it in pairs(table) do if getPlayerItemCount(cid, it) > 0 then table.insert(has, it) end end return (#has == #table) end local t = { itens = {2142, 4852}, tempo = 86400,-- tempo de Espera level = 169, -- level necessário inicio = { -- posição inicial dos players -- {x = 1994, y = 1794, z = 5}, -- pos play 1 {x = 1995, y = 1794, z = 5}, -- pos play 2 -- {x = 1997, y = 1794, z = 5}, -- pos play 3 }, fim = { -- posição para onde os players irão -- {x = 942, y = 3773, z = 7}, {x = 940, y = 3773, z = 7}, -- {x = 941, y = 3773, z = 7}, } } function onUse(cid, item, fromPosition, itemEx, toPosition) local players = {} for _, k in ipairs(t.inicio) do local creatureOnPos = getTopCreature(k).uid if not (isCreature(creatureOnPos) and isPlayer(creatureOnPos)) then doPlayerSendTextMessage(cid,25, "Está faltando jogadores para entrar na missão, verifique se todos estão nos pisos corretos.") return true end if(getPlayerLevel(creatureOnPos) < t.level) then doPlayerSendTextMessage(cid,25, "O Jogador ".. getCreatureName(creatureOnPos) .." não tem o nível requirido para entrar na missão.") return true end if not hasItems(creatureOnPos, t.itens) then doPlayerSendTextMessage(cid,22, "O Jogador ".. getCreatureName(creatureOnPos) .." não tem os itens requiridos para entrar na missão.") return true end if not (#getCreatureSummons(creatureOnPos) >= 1) then doPlayerSendTextMessage(cid,22, "O Jogador ".. getCreatureName(creatureOnPos) .." não está com seu pokemon fora da pokebola.") return true end table.insert(players, creatureOnPos) end for i, pid in ipairs(players) do doSendMagicEffect(t.inicio, 2) doTeleportThing(pid, t.fim, false) doSendMagicEffect(t.fim, 10) setGlobalStorageValue(cid, 1115547, os.time() + t.tempo) end return true end
[18/11/2018 13:58:05] [Error - Action Interface]
[18/11/2018 13:58:05] datapack/actions/scripts/quests/PortaMysterious.lua:onUse
[18/11/2018 13:58:05] Description:
[18/11/2018 13:58:05] datapack/actions/scripts/quests/PortaMysterious.lua:5: attempt to call field 'insert' (a nil value)
[18/11/2018 13:58:05] stack traceback:
[18/11/2018 13:58:05] datapack/actions/scripts/quests/PortaMysterious.lua:5: in function 'hasItems'
[18/11/2018 13:58:05] datapack/actions/scripts/quests/PortaMysterious.lua:41: in function <datapack/actions/scripts/quests/PortaMysterious.lua:27>
--- By Marshmello and Crypter local function hasItems(cid, _table) local has = {} for _, it in pairs(_table) do if getPlayerItemCount(cid, it) > 0 then table.insert(has, it) end end return (#has == #table) end local t = { itens = {2142, 4852}, tempo = 86400,-- tempo de Espera level = 169, -- level necessário inicio = { -- posição inicial dos players -- {x = 1994, y = 1794, z = 5}, -- pos play 1 {x = 1995, y = 1794, z = 5}, -- pos play 2 -- {x = 1997, y = 1794, z = 5}, -- pos play 3 }, fim = { -- posição para onde os players irão -- {x = 942, y = 3773, z = 7}, {x = 940, y = 3773, z = 7}, -- {x = 941, y = 3773, z = 7}, } } function onUse(cid, item, fromPosition, itemEx, toPosition) local players = {} for _, k in ipairs(t.inicio) do local creatureOnPos = getTopCreature(k).uid if not (isCreature(creatureOnPos) and isPlayer(creatureOnPos)) then doPlayerSendTextMessage(cid,25, "Está faltando jogadores para entrar na missão, verifique se todos estão nos pisos corretos.") return true end if(getPlayerLevel(creatureOnPos) < t.level) then doPlayerSendTextMessage(cid,25, "O Jogador ".. getCreatureName(creatureOnPos) .." não tem o nível requirido para entrar na missão.") return true end if not hasItems(creatureOnPos, t.itens) then doPlayerSendTextMessage(cid,22, "O Jogador ".. getCreatureName(creatureOnPos) .." não tem os itens requiridos para entrar na missão.") return true end if not (#getCreatureSummons(creatureOnPos) >= 1) then doPlayerSendTextMessage(cid,22, "O Jogador ".. getCreatureName(creatureOnPos) .." não está com seu pokemon fora da pokebola.") return true end table.insert(players, creatureOnPos) end for i, pid in ipairs(players) do doSendMagicEffect(t.inicio, 2) doTeleportThing(pid, t.fim, false) doSendMagicEffect(t.fim, 10) setGlobalStorageValue(cid, 1115547, os.time() + t.tempo) end return true end
info
Grupo: Conde
Registrado: 21/04/16
Posts: 831
Reputação: +271
Gênero: Masculino

Agora, Crypter disse:--- By Marshmello and Crypter local function hasItems(cid, _table) local has = {} for _, it in pairs(_table) do if getPlayerItemCount(cid, it) > 0 then table.insert(has, it) end end return (#has == #table) end local t = { itens = {2142, 4852}, tempo = 86400,-- tempo de Espera level = 169, -- level necessário inicio = { -- posição inicial dos players -- {x = 1994, y = 1794, z = 5}, -- pos play 1 {x = 1995, y = 1794, z = 5}, -- pos play 2 -- {x = 1997, y = 1794, z = 5}, -- pos play 3 }, fim = { -- posição para onde os players irão -- {x = 942, y = 3773, z = 7}, {x = 940, y = 3773, z = 7}, -- {x = 941, y = 3773, z = 7}, } } function onUse(cid, item, fromPosition, itemEx, toPosition) local players = {} for _, k in ipairs(t.inicio) do local creatureOnPos = getTopCreature(k).uid if not (isCreature(creatureOnPos) and isPlayer(creatureOnPos)) then doPlayerSendTextMessage(cid,25, "Está faltando jogadores para entrar na missão, verifique se todos estão nos pisos corretos.") return true end if(getPlayerLevel(creatureOnPos) < t.level) then doPlayerSendTextMessage(cid,25, "O Jogador ".. getCreatureName(creatureOnPos) .." não tem o nível requirido para entrar na missão.") return true end if not hasItems(creatureOnPos, t.itens) then doPlayerSendTextMessage(cid,22, "O Jogador ".. getCreatureName(creatureOnPos) .." não tem os itens requiridos para entrar na missão.") return true end if not (#getCreatureSummons(creatureOnPos) >= 1) then doPlayerSendTextMessage(cid,22, "O Jogador ".. getCreatureName(creatureOnPos) .." não está com seu pokemon fora da pokebola.") return true end table.insert(players, creatureOnPos) end for i, pid in ipairs(players) do doSendMagicEffect(t.inicio, 2) doTeleportThing(pid, t.fim, false) doSendMagicEffect(t.fim, 10) setGlobalStorageValue(cid, 1115547, os.time() + t.tempo) end return true end
Tudo certo, só que os player não estão sendo teleportado com as pos "t.fim" , mais se eu por umas pos random ela teleporta
1 minuto atrás, Marshmello disse:Tudo certo, só que os player não estão sendo teleportado com as pos "t.fim" , mais se eu por umas pos random ela teleporta
Não mexi nessa parte, porém aqui esta arrumado:
--- By Marshmello and Crypter local function hasItems(cid, _table) local has = {} for _, it in pairs(_table) do if getPlayerItemCount(cid, it) > 0 then table.insert(has, it) end end return (#has == #table) end local t = { itens = {2142, 4852}, tempo = 86400,-- tempo de Espera level = 169, -- level necessário inicio = { -- posição inicial dos players -- {x = 1994, y = 1794, z = 5}, -- pos play 1 {x = 1995, y = 1794, z = 5}, -- pos play 2 -- {x = 1997, y = 1794, z = 5}, -- pos play 3 }, fim = {x = 940, y = 3773, z = 7}, } function onUse(cid, item, fromPosition, itemEx, toPosition) local players = {} for _, k in ipairs(t.inicio) do local creatureOnPos = getTopCreature(k).uid if not (isCreature(creatureOnPos) and isPlayer(creatureOnPos)) then doPlayerSendTextMessage(cid,25, "Está faltando jogadores para entrar na missão, verifique se todos estão nos pisos corretos.") return true end if(getPlayerLevel(creatureOnPos) < t.level) then doPlayerSendTextMessage(cid,25, "O Jogador ".. getCreatureName(creatureOnPos) .." não tem o nível requirido para entrar na missão.") return true end if not hasItems(creatureOnPos, t.itens) then doPlayerSendTextMessage(cid,22, "O Jogador ".. getCreatureName(creatureOnPos) .." não tem os itens requiridos para entrar na missão.") return true end if not (#getCreatureSummons(creatureOnPos) >= 1) then doPlayerSendTextMessage(cid,22, "O Jogador ".. getCreatureName(creatureOnPos) .." não está com seu pokemon fora da pokebola.") return true end table.insert(players, creatureOnPos) end for i, pid in ipairs(players) do doSendMagicEffect(getCreaturePosition(pid), 2) doTeleportThing(pid, t.fim, false) doSendMagicEffect(t.fim, 10) setGlobalStorageValue(cid, 1115547, os.time() + t.tempo) end return true end
info
Grupo: Conde
Registrado: 21/04/16
Posts: 831
Reputação: +271
Gênero: Masculino

11 minutos atrás, Crypter disse:Não mexi nessa parte, porém aqui esta arrumado:
--- By Marshmello and Crypter local function hasItems(cid, _table) local has = {} for _, it in pairs(_table) do if getPlayerItemCount(cid, it) > 0 then table.insert(has, it) end end return (#has == #table) end local t = { itens = {2142, 4852}, tempo = 86400,-- tempo de Espera level = 169, -- level necessário inicio = { -- posição inicial dos players -- {x = 1994, y = 1794, z = 5}, -- pos play 1 {x = 1995, y = 1794, z = 5}, -- pos play 2 -- {x = 1997, y = 1794, z = 5}, -- pos play 3 }, fim = {x = 940, y = 3773, z = 7}, } function onUse(cid, item, fromPosition, itemEx, toPosition) local players = {} for _, k in ipairs(t.inicio) do local creatureOnPos = getTopCreature(k).uid if not (isCreature(creatureOnPos) and isPlayer(creatureOnPos)) then doPlayerSendTextMessage(cid,25, "Está faltando jogadores para entrar na missão, verifique se todos estão nos pisos corretos.") return true end if(getPlayerLevel(creatureOnPos) < t.level) then doPlayerSendTextMessage(cid,25, "O Jogador ".. getCreatureName(creatureOnPos) .." não tem o nível requirido para entrar na missão.") return true end if not hasItems(creatureOnPos, t.itens) then doPlayerSendTextMessage(cid,22, "O Jogador ".. getCreatureName(creatureOnPos) .." não tem os itens requiridos para entrar na missão.") return true end if not (#getCreatureSummons(creatureOnPos) >= 1) then doPlayerSendTextMessage(cid,22, "O Jogador ".. getCreatureName(creatureOnPos) .." não está com seu pokemon fora da pokebola.") return true end table.insert(players, creatureOnPos) end for i, pid in ipairs(players) do doSendMagicEffect(getCreaturePosition(pid), 2) doTeleportThing(pid, t.fim, false) doSendMagicEffect(t.fim, 10) setGlobalStorageValue(cid, 1115547, os.time() + t.tempo) end return true end
Vlw meu manoo, ajudou bastante ❤️
info
Grupo: Conde
Registrado: 21/04/16
Posts: 831
Reputação: +271
Gênero: Masculino

info
Grupo: Conde
Registrado: 21/04/16
Posts: 831
Reputação: +271
Gênero: Masculino
Salve Jovens, eu tava fazendo umas parada aqui porem quebrei muito a cabeça e n deu certo,
a script n reconhece que os player esteja com o pokemon para fora da ball, já usei creatureSummons , tanto uma verificação no sloot mesmo assim ele teleporta sem ter o pokemon, alguem pode dar uma força??
Meu Script
--- By Marshmello
local t = {
tempo = 86400,-- tempo de Espera
level = 169, -- level necessário
inicio = { -- posição inicial dos players
-- {x = 1994, y = 1794, z = 5}, -- pos play 1
{x = 1995, y = 1794, z = 5}, -- pos play 2
-- {x = 1997, y = 1794, z = 5}, -- pos play 3
},
fim = { -- posição para onde os players irão
-- {x = 942, y = 3773, z = 7},
{x = 940, y = 3773, z = 7},
-- {x = 941, y = 3773, z = 7},
}}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local test = {}
for _, k in ipairs(t.inicio) do
local x = getTopCreature(k).uid
if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.level) then
doPlayerSendTextMessage(cid,25, "Voce precisa de um grupo de 4 Player para passar")
return true
end
if (x == 0 or getPlayerItemCount(x, 2142) < 1 or getPlayerItemCount(x, 4852) < 1 ) then
doPlayerSendTextMessage(cid,22, "Falta os itens")
return true
end
if (x == 0 or not getCreatureName(getCreatureSummons(x)[1] == POKEMON) then
doPlayerSendTextMessage(cid,22, "Sem pokemon")
return true
end
table.insert(test, x)
end
for i, pid in ipairs(test) do
doSendMagicEffect(t.inicio, 2)
doTeleportThing(pid, t.fim, false)
doSendMagicEffect(t.fim, 10)
setGlobalStorageValue(cid, 1115547, os.time() + t.tempo)
end
return true
end
--------------------- Marshmello ---------------------------