Puricute 1 Postado Novembro 18, 2012 Share Postado Novembro 18, 2012 Olá, gostaria que me ajudassem com uma coisa.. Queria colocar uma alavanca de teleporte para 21 players(no máximo sem requisito de level e nenhum outro.. E que se caso algumas das 21 posições não estiverem ocupada(por players ) que mesmo assim a alavanca funcionasse. -- posição inicial dos players { {x=106,y=30,z=15}, {x=107,y=30,z=15}, {x=108,y=30,z=15}, {x=109,y=30,z=15}, {x=110,y=30,z=15}, {x=114,y=30,z=15}, {x=115,y=30,z=15}, {x=116,y=30,z=15}, {x=117,y=30,z=15}, {x=118,y=30,z=15}, {x=112,y=35,z=15}, {x=106,y=40,z=15}, {x=107,y=40,z=15}, {x=108,y=40,z=15}, {x=109,y=40,z=15}, {x=110,y=40,z=15}, {x=114,y=40,z=15}, {x=115,y=40,z=15}, {x=116,y=40,z=15}, {x=117,y=40,z=15}, {x=118,y=40,z=15}, }, -- posição para onde serão teleportados { {x=106,y=53,z=15}, {x=107,y=53,z=15}, {x=108,y=53,z=15}, {x=109,y=53,z=15}, {x=110,y=53,z=15}, {x=114,y=53,z=15}, {x=115,y=53,z=15}, {x=116,y=53,z=15}, {x=117,y=53,z=15}, {x=118,y=53,z=15}, {x=112,y=58,z=15}, {x=106,y=68,z=15}, {x=107,y=68,z=15}, {x=108,y=68,z=15}, {x=109,y=68,z=15}, {x=110,y=68,z=15}, {x=114,y=68,z=15}, {x=115,y=68,z=15}, {x=116,y=68,z=15}, {x=117,y=68,z=15}, {x=118,y=68,z=15}, } } Obg. Link para o comentário Compartilhar em outros sites More sharing options...
0 brun123 369 Postado Novembro 18, 2012 Share Postado Novembro 18, 2012 vê se funciona assim: function onUse(cid, item, frompos, item2, topos) local startpositions = { {x=106,y=30,z=15}, {x=107,y=30,z=15}, {x=108,y=30,z=15}, {x=109,y=30,z=15}, {x=110,y=30,z=15}, {x=114,y=30,z=15}, {x=115,y=30,z=15}, {x=116,y=30,z=15}, {x=117,y=30,z=15}, {x=118,y=30,z=15}, {x=112,y=35,z=15}, {x=106,y=40,z=15}, {x=107,y=40,z=15}, {x=108,y=40,z=15}, {x=109,y=40,z=15}, {x=110,y=40,z=15}, {x=114,y=40,z=15}, {x=115,y=40,z=15}, {x=116,y=40,z=15}, {x=117,y=40,z=15}, {x=118,y=40,z=15}} for _, pos in pairs (startpositions) do local creature = getTopCreature(pos).uid if isPlayer(creature) then local newpos = {x = pos.x, y = pos.y, z = pos.z} if pos.y == 30 then newpos.y = 53 elseif pos.y == 35 then newpos.y = 58 elseif pos.y == 40 then newpos.y = 68 end doTeleportThing(creature, newpos, false) addEvent(doSendMagicEffect, 10, newpos, CONST_ME_TELEPORT) end end return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) end Link para o comentário Compartilhar em outros sites More sharing options...
0 Puricute 1 Postado Novembro 21, 2012 Autor Share Postado Novembro 21, 2012 funcionou sim brigadão ! brun123, você pode fazer mais um script de alavanca pra mim ? ;p só que dessa vez com requisito de level minimo de 2500.. e que funcione mesmo se alguma posição não estiver ocupada ? ._. level minimo = 2500 pos inicial = { {x=106,y=53,z=15}, {x=107,y=53,z=15}, {x=108,y=53,z=15}, {x=109,y=53,z=15}, {x=110,y=53,z=15}, {x=114,y=53,z=15}, {x=115,y=53,z=15}, {x=116,y=53,z=15}, {x=117,y=53,z=15}, {x=118,y=53,z=15}, {x=112,y=58,z=15}, {x=106,y=63,z=15}, {x=107,y=63,z=15}, {x=108,y=63,z=15}, {x=109,y=63,z=15}, {x=110,y=63,z=15}, {x=114,y=63,z=15}, {x=115,y=63,z=15}, {x=116,y=63,z=15}, {x=117,y=63,z=15}, {x=118,y=63,z=15}} pos destino = { {x=151,y=31,z=15}, {x=152,y=31,z=15}, {x=153,y=31,z=15}, {x=154,y=31,z=15}, {x=155,y=31,z=15}, {x=151,y=32,z=15}, {x=152,y=32,z=15}, {x=153,y=32,z=15}, {x=154,y=32,z=15}, {x=155,y=32,z=15}, {x=155,y=35,z=15}, {x=181,y=123,z=15}, {x=182,y=123,z=15}, {x=183,y=123,z=15}, {x=184,y=123,z=15}, {x=185,y=123,z=15}, {x=181,y=124,z=15}, {x=182,y=124,z=15}, {x=183,y=124,z=15}, {x=184,y=124,z=15}, {x=185,y=124,z=15}} Link para o comentário Compartilhar em outros sites More sharing options...
0 SkyLigh 453 Postado Novembro 21, 2012 Share Postado Novembro 21, 2012 Duvida sanada reportado Link para o comentário Compartilhar em outros sites More sharing options...
0 brun123 369 Postado Novembro 21, 2012 Share Postado Novembro 21, 2012 local startpos = { {x=106,y=53,z=15}, {x=107,y=53,z=15}, {x=108,y=53,z=15}, {x=109,y=53,z=15}, {x=110,y=53,z=15}, {x=114,y=53,z=15}, {x=115,y=53,z=15}, {x=116,y=53,z=15}, {x=117,y=53,z=15}, {x=118,y=53,z=15}, {x=112,y=58,z=15}, {x=106,y=63,z=15}, {x=107,y=63,z=15}, {x=108,y=63,z=15}, {x=109,y=63,z=15}, {x=110,y=63,z=15}, {x=114,y=63,z=15}, {x=115,y=63,z=15}, {x=116,y=63,z=15}, {x=117,y=63,z=15}, {x=118,y=63,z=15}} local finalpos = { {x=151,y=31,z=15}, {x=152,y=31,z=15}, {x=153,y=31,z=15}, {x=154,y=31,z=15}, {x=155,y=31,z=15}, {x=151,y=32,z=15}, {x=152,y=32,z=15}, {x=153,y=32,z=15}, {x=154,y=32,z=15}, {x=155,y=32,z=15}, {x=155,y=35,z=15}, {x=181,y=123,z=15}, {x=182,y=123,z=15}, {x=183,y=123,z=15}, {x=184,y=123,z=15}, {x=185,y=123,z=15}, {x=181,y=124,z=15}, {x=182,y=124,z=15}, {x=183,y=124,z=15}, {x=184,y=124,z=15}, {x=185,y=124,z=15}} local minlevel = 2500 function onUse(cid, item, frompos, item2, topos) for _ = 1, #startpos do local uid = getTopCreature(startpos[_]).uid if isPlayer(uid) and getPlayerLevel(uid) >= minlevel then doTeleportThing(uid, finalpos[_], false) addEvent(doSendMagicEffect, 10, finalpos[_], CONST_ME_TELEPORT) end end return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) end Link para o comentário Compartilhar em outros sites More sharing options...
0 Stigal 584 Postado Novembro 21, 2012 Share Postado Novembro 21, 2012 Movido Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
Puricute 1
Olá, gostaria que me ajudassem com uma coisa..
Queria colocar uma alavanca de teleporte para 21 players(no máximo sem requisito de level e nenhum outro.. E que se caso algumas das 21 posições não estiverem ocupada(por players ) que mesmo assim a alavanca funcionasse.
-- posição inicial dos players
{
{x=106,y=30,z=15},
{x=107,y=30,z=15},
{x=108,y=30,z=15},
{x=109,y=30,z=15},
{x=110,y=30,z=15},
{x=114,y=30,z=15},
{x=115,y=30,z=15},
{x=116,y=30,z=15},
{x=117,y=30,z=15},
{x=118,y=30,z=15},
{x=112,y=35,z=15},
{x=106,y=40,z=15},
{x=107,y=40,z=15},
{x=108,y=40,z=15},
{x=109,y=40,z=15},
{x=110,y=40,z=15},
{x=114,y=40,z=15},
{x=115,y=40,z=15},
{x=116,y=40,z=15},
{x=117,y=40,z=15},
{x=118,y=40,z=15},
},
-- posição para onde serão teleportados
{
{x=106,y=53,z=15},
{x=107,y=53,z=15},
{x=108,y=53,z=15},
{x=109,y=53,z=15},
{x=110,y=53,z=15},
{x=114,y=53,z=15},
{x=115,y=53,z=15},
{x=116,y=53,z=15},
{x=117,y=53,z=15},
{x=118,y=53,z=15},
{x=112,y=58,z=15},
{x=106,y=68,z=15},
{x=107,y=68,z=15},
{x=108,y=68,z=15},
{x=109,y=68,z=15},
{x=110,y=68,z=15},
{x=114,y=68,z=15},
{x=115,y=68,z=15},
{x=116,y=68,z=15},
{x=117,y=68,z=15},
{x=118,y=68,z=15},
}
}
Obg.
Link para o comentário
Compartilhar em outros sites
5 respostass a esta questão
Posts Recomendados