Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Queria que algum ajuda-se a arrumar . E pq não esta nascendo o monstro quando pusha a alavanca caso não consiga arrumar tenho essa segunda solução

porque eu coloquei os monstros pelo rme ai quando eles apertão na alavanca eles somem ,

 

 

Anini

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local config = {
position = {x=1183, y=1224, z=7}, -- Posição aonde sera criado o teleport
position1 = {x=1216, y=1250, z=7},
position2 = {x=1216, y=1258, z=7},
position3 = {x=1222, y=1250, z=7},
position4 = {x=1222, y=1258, z=7},
fromPosition = {x=1215, y=1249, z=7},
toPosition = {x=1223, y=1259, z=7},
walls = {x=1177, y=1224, z=7},
wallr = {x=1177, y=1224, z=7,  stackpos = 1},
id = 1498,
time = 2 -- tempo que o teleport ira sumir em minutos
}
 
 
 
 
local monsterPositions = {
{x = 1216, y = 1252, z = 7}, --posição do monstro 1
{x = 1216, y = 1254, z = 7},  --posição do monstro 2
{x = 1216, y = 1256, z = 7},  --posição do monstro 3
{x = 1222, y = 1252, z = 7}, --posição do monstro 4
{x = 75, y = 1254, z = 7}, --posição do monstro 5
{x = 75, y = 1256, z = 7}  --posição do monstro 6
}
 
 
 
 
local t = {
level = 120, -- level minimo para poder entrar
inicio = -- posical inicial dos players
{
{x=1182,y=1224,z=7}
},
fim =  -- posição para onde serão teleportados
{
{x=1221,y=1254,z=7}
}
}
local time = 120
local gsto = 4567
 
 
 
 
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
doPlayerSendCancel(cid, 'Não tem 5 players.')
return true
end
table.insert(test, x)
end
for _, mPos in ipairs(monsterPositions) do
local mob = getTopCreature(cPos).uid
if mob ~= 0 and isMonster(mob) then
doRemoveCreature(mob) 
doCreateMonster("Annihilon", mPos)
else
doCreateMonster("Annihilon", mPos)
end 
end
for i, pid in ipairs(test) do
doSendMagicEffect(t.inicio, CONST_ME_POFF)
doTeleportThing(pid, t.fim, false)
doSendMagicEffect(t.fim, CONST_ME_ENERGYAREA)
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
doCreateItem(config.id, 1, config.walls)
for i = 1,time do
formula = time - 1*i
addEvent(doSendAnimatedText,i*1000, config.position, formula, math.random(1, 255))
addEvent(doSendAnimatedText,i*1000, config.position1, formula, math.random(1, 255))
addEvent(doSendAnimatedText,i*1000, config.position2, formula, math.random(1, 255))
addEvent(doSendAnimatedText,i*1000, config.position3, formula, math.random(1, 255))
addEvent(doSendAnimatedText,i*1000, config.position4, formula, math.random(1, 255))
end
function removeWall()
return true
end
addEvent(removeWall, config.time*60*1000)
for x = config.fromPosition.x, config.toPosition.x do
for y = config.fromPosition.y, config.toPosition.y do
for z = config.fromPosition.z, config.toPosition.z do
areapos = {x = x, y = y, z = z, stackpos = 253}
getMonsters = getThingfromPos(areapos)
if isMonster(getMonsters.uid) then
doRemoveCreature(getMonsters.uid)
end
end
end
end
function removePlayer()
if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
end
end
addEvent(removePlayer, config.time*60*1000)
return TRUE
end
 
 
Anihi
 
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
position = {x=1183, y=1224, z=7}, -- Posição aonde sera criado o teleport
position1 = {x=1216, y=1250, z=7},
position2 = {x=1216, y=1258, z=7},
position3 = {x=1222, y=1250, z=7},
position4 = {x=1222, y=1258, z=7},
fromPosition = {x=1215, y=1249, z=7},
toPosition = {x=1223, y=1259, z=7},
walls = {x=1177, y=1224, z=7},
wallr = {x=1177, y=1224, z=7,  stackpos = 1},
id = 1498,
time = 2 -- tempo que o teleport ira sumir em minutos
}
local t = {
level = 120, -- level minimo para poder entrar
inicio = -- posical inicial dos players
{
{x=1184,y=1224,z=7},
{x=1183,y=1224,z=7},
{x=1182,y=1224,z=7},
{x=1181,y=1224,z=7},
{x=1180,y=1224,z=7}
},
fim =  -- posição para onde serão teleportados
{
{x=1221,y=1254,z=7},
{x=1220,y=1254,z=7},
{x=1219,y=1254,z=7},
{x=1218,y=1254,z=7},
{x=1217,y=1254,z=7}
}
}
local time = 120
local sto = 5937
 
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
doPlayerSendCancel(cid, 'Você precisa de 5 jogadores')
return true
end
if getGlobalStorageValue(sto) == 1 then
doPlayerSendCancel(cid, 'Espere o tempo acabar')
return true
end
table.insert(test, x)
end
for i, pid in ipairs(test) do
doSendMagicEffect(t.inicio, CONST_ME_POFF)
doTeleportThing(pid, t.fim, false)
doSendMagicEffect(t.fim, CONST_ME_ENERGYAREA)
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
setGlobalStorageValue(sto, 1)
for i = 1,time do
formula = time - 1*i
addEvent(doSendAnimatedText,i*1000, config.position, formula, math.random(1, 255))
addEvent(doSendAnimatedText,i*1000, config.position1, formula, math.random(1, 255))
addEvent(doSendAnimatedText,i*1000, config.position2, formula, math.random(1, 255))
addEvent(doSendAnimatedText,i*1000, config.position3, formula, math.random(1, 255))
addEvent(doSendAnimatedText,i*1000, config.position4, formula, math.random(1, 255))
end
function removeWall()
setGlobalStorageValue(sto, -1)
return true
end
addEvent(removeWall, config.time*60*1000)
for x = config.fromPosition.x, config.toPosition.x do
for y = config.fromPosition.y, config.toPosition.y do
for z = config.fromPosition.z, config.toPosition.z do
areapos = {x = x, y = y, z = z, stackpos = 253}
getMonsters = getThingfromPos(areapos)
if isMonster(getMonsters.uid) then
doRemoveCreature(getMonsters.uid)
end
end
end
end
function removePlayer()
if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
end
end
addEvent(removePlayer, config.time*60*1000)
return TRUE
end
  • Respostas 6
  • Visualizações 396
  • Created
  • Última resposta

Top Posters In This Topic

Postado

Você ajustou a posição dos monstros?

local monsterPositions = {
{x = 1216, y = 1252, z = 7}, --posição do monstro 1
{x = 1216, y = 1254, z = 7},  --posição do monstro 2
{x = 1216, y = 1256, z = 7},  --posição do monstro 3
{x = 1222, y = 1252, z = 7}, --posição do monstro 4
{x = 75, y = 1254, z = 7}, --posição do monstro 5
{x = 75, y = 1256, z = 7}  --posição do monstro 6
}

Aqui funcionou certinho.

O que deve estar acontecendo é que entra na sala, os monstros são criados no lugar que o Script pede, mas esse lugar não é o que vc tem no SEU mapa.

 

Confere se é isto.

5YkRF3w.gif

 

 

 

 

 

 

CzysZUR.gifytaam6k.png

 

 

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