Postado Setembro 30, 2017 7 anos Autor Em 30/09/2017 em 21:34, antharaz disse: @JcA Quando o outro player morre nessa área de pvp tile ele é teleportado pra fora certo? Se sim, só precisa me passar a pos superior esquerda e inferior direita da parte de dentro de sua arena e eu adapto o script. superiro esquerda: 1015 1019 4 inferior direita: 1030 1033 4 O player vencedor só recebe a premiação e é teleportado se a arena tiver sem o tool "pvp tile", o roxinho da imagem a cima, se tiver não funciona, é pra funciona com o tool Editado Setembro 30, 2017 7 anos por JcA (veja o histórico de edições)
Postado Setembro 30, 2017 7 anos @JcA Pode deixar com o 'pvp tile' roxo no mapa e usar este script abaixo: Mostrar conteúdo oculto local config = { pos = { pos_entrada = { --POSICAO DOS SQM PRETOS {x=1016,y=1026,z=4}, {x=1016,y=1028,z=4} }, pos_dentro = { --POS DOS SQM VERMELHOS {x=1019,y=1027,z=4}, {x=1027,y=1027,z=4} }, pos_ganhador = {x=1013,y=1027,z=4}, pos_area = { {x=1015,y=1019,z=4}, {x=1030,y=1033,z=4} } }, premiacao = { --PREMIACAO {id=2160,quantidade=1}, {id=2160,quantidade=1}, {id=2160,quantidade=1} }, msg = { ganhou = 'You killed the enemy, and was the last to stay in the arena, therefore, won the following awards: ', entrou = 'You are inside the arena, now in front of the enemy with honor!' }, level_minimo = 250 } local p = {} function onUse(cid, item, fromPosition, itemEx, toPosition) if #p > 0 then doSendMagicEffect(fromPosition,2) return false end for _,pos in pairs(config.pos.pos_entrada) do local player = getTopCreature(pos).uid if not isPlayer(player) or getPlayerLevel(player) < config.level_minimo then p = {} doSendMagicEffect(fromPosition,2) return false end table.insert(p,player) end for _,player in pairs(p) do doTeleportThing(player,config.pos.pos_dentro[_]) doPlayerSendTextMessage(player, 22, 'You are inside the arena, now in front of the enemy with honor!') end verifica() return true end function verifica() for _,player in pairs(p) do local po = getThingPos(player) if po.x < config.pos.pos_area[1].x or po.x > config.pos.pos_area[2].x or po.y < config.pos.pos_area[1].y or po.y > config.pos.pos_area[2].y then table.remove(p,_) player = p[1] doTeleportThing(player,config.pos.pos_ganhador) local texto = config.msg.ganhou for a,t in pairs(config.premiacao) do doPlayerAddItem(player,t.id,t.quantidade) texto = a ~= #config.premiacao and (texto..t.quantidade..' '..getItemNameById(t.id)..', ') or (texto..t.quantidade..' '..getItemNameById(t.id)..'.') end doPlayerSendTextMessage(player, 22, texto) p = {} return true end end addEvent(verifica,1000) end
Postado Setembro 30, 2017 7 anos Autor @antharaz Achei que era delay, mas enfim, só volta para posição de ganhador mesmo, se o player retornar na sala de arena, não vai automaticamente quando ganha Editado Setembro 30, 2017 7 anos por JcA (veja o histórico de edições)
Postado Setembro 30, 2017 7 anos Solução @JcA Eu realmente não to entendendo o que você ta falando kkkkk' não tem algum canal para nos comunicarmos por voz não? seria mais fácil. ---EDIT Segue o código acrescentado com a verificação de andar: Mostrar conteúdo oculto local config = { pos = { pos_entrada = { --POSICAO DOS SQM PRETOS {x=1016,y=1026,z=4}, {x=1016,y=1028,z=4} }, pos_dentro = { --POS DOS SQM VERMELHOS {x=1019,y=1027,z=4}, {x=1027,y=1027,z=4} }, pos_ganhador = {x=1013,y=1027,z=4}, pos_area = { {x=1015,y=1019,z=4}, {x=1030,y=1033,z=4} } }, premiacao = { --PREMIACAO {id=2160,quantidade=1}, {id=2160,quantidade=1}, {id=2160,quantidade=1} }, msg = { ganhou = 'You killed the enemy, and was the last to stay in the arena, therefore, won the following awards: ', entrou = 'You are inside the arena, now in front of the enemy with honor!' }, level_minimo = 250 } local p = {} function onUse(cid, item, fromPosition, itemEx, toPosition) if #p > 0 then doSendMagicEffect(fromPosition,2) return false end for _,pos in pairs(config.pos.pos_entrada) do local player = getTopCreature(pos).uid if not isPlayer(player) or getPlayerLevel(player) < config.level_minimo then p = {} doSendMagicEffect(fromPosition,2) return false end table.insert(p,player) end for _,player in pairs(p) do doTeleportThing(player,config.pos.pos_dentro[_]) doPlayerSendTextMessage(player, 22, 'You are inside the arena, now in front of the enemy with honor!') end verifica() return true end function verifica() for _,player in pairs(p) do local po = getThingPos(player) if po.x < config.pos.pos_area[1].x or po.x > config.pos.pos_area[2].x or po.y < config.pos.pos_area[1].y or po.y > config.pos.pos_area[2].y or po.z ~= config.pos.pos_area[1].z then table.remove(p,_) player = p[1] doTeleportThing(player,config.pos.pos_ganhador) local texto = config.msg.ganhou for a,t in pairs(config.premiacao) do doPlayerAddItem(player,t.id,t.quantidade) texto = a ~= #config.premiacao and (texto..t.quantidade..' '..getItemNameById(t.id)..', ') or (texto..t.quantidade..' '..getItemNameById(t.id)..'.') end doPlayerSendTextMessage(player, 22, texto) p = {} return true end end addEvent(verifica,1000) end Editado Setembro 30, 2017 7 anos por antharaz (veja o histórico de edições)
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.