Ir para conteúdo

Featured Replies

Postado

@trancx123 em

checking.x=checking.x+1
if checking.x>ending.x then
checking.x=starting.x
checking.y=checking.y+1
end
until checking.y>ending.y
if players==0 then
trash= {x=640, y=65, z=7}

640 , 65 , 7 - vc coloca um numero em algum local da agua do seu mapa, ao puxar alavanca o demon será teleportado pra lá. se eu não me engano é nessa parte.

  • Respostas 15
  • Visualizações 844
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado
  • Autor

pera, acabei de testar oq a ragnar mandou, vou ver se mudando aquilo pra um lugar de agua funfa

9 minutos atrás, helix758 disse:

@trancx123 em


checking.x=checking.x+1
if checking.x>ending.x then
checking.x=starting.x
checking.y=checking.y+1
end
until checking.y>ending.y
if players==0 then
trash= {x=640, y=65, z=7}

640 , 65 , 7 - vc coloca um numero em algum local da agua do seu mapa, ao puxar alavanca o demon será teleportado pra lá. se eu não me engano é nessa parte.

acabei de mudar, botar um lugar de agua mas continua sem ir

7 minutos atrás, Ragnar Lothbrook disse:

É fato @helix758.

 

Já que ele removeu a tag que eu adicionei:

  Ocultar conteúdo


if thing.itemid > 0 then                                                    
doRemoveCreature(thing.uid)

 

é pra adicionar isso em qual parte do script?

Postado
Spoiler

local room = { -- room with demons
        fromX = 1648,      ---- canto superior esquerdo da sala ( incluir a sala toda, inclusive a parte dos baus)
        fromY = 1786,
        fromZ = 6,
      
		toX = 1655, ---- canto inferior direito da sala
        toY = 1794,
        toZ = 6
        }

        
local monster_pos = { -- posição dos monstros
        
[1] = {pos = {1650, 1788, 6}, monster = "Demon"},      
[2] = {pos = {1651, 1792, 6}, monster = "Demon"},       
[3] = {pos = {1652, 1788, 6}, monster = "Demon"},       
[4] = {pos = {1653, 1792, 6}, monster = "Demon"},       
[5] = {pos = {1654, 1790, 6}, monster = "Demon"},       
[6] = {pos = {1655, 1790, 6}, monster = "Orshabaal"}
        }

        
local players_pos = {          ---- posição onde os players devem estar
{x = 1019, y = 1542, z = 6, stackpos = 253},       
{x = 1018, y = 1542, z = 6, stackpos = 253},      
{x = 1017, y = 1542, z = 6, stackpos = 253},       
{x = 1016, y = 1542, z = 6, stackpos = 253}
}

        

local new_player_pos = { --- posição para onde irao ao puxar alavanca
        
{x = 1653, y = 1790, z = 6},        
{x = 1652, y = 1790, z = 6},        
{x = 1651, y = 1790, z = 6},        
{x = 1650, y = 1790, z = 6}
}

        

local playersOnly = "yes" -- yes- apenas players. no- monstros como summons tambem podem substituir um local vazio
        
local questLevel = 100  --- level necessario para entrar na quest, checado pela alavanca

     
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                                        
local door = getTileItemById({x=1656, y=1790, z=6}, 5109).uid	----- posição da porta apos o segundo monstro				
if door > 0 then						
doTransformItem(door, 5108)					
end

										
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[i], FALSE)                                             
doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA)                                               
doTransformItem(item.uid,1946)                                       
end                               
else                                       
doPlayerSendTextMessage(cid,22,"Only players can do this quest.")               --- mensagem caso o OnlyPlayers esteja YES, e existe um summmon na pos                 
end                       
else                               
doPlayerSendTextMessage(cid,22,"All Players have to be level "..questLevel.." to do this quest.")      --- mensagem caso player nao tenha level                  
end               
else                       
doPlayerSendTextMessage(cid,22,"You need "..table.getn(players_pos).." players to do this quest.")       ----- mensagem caso falte players         
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,22,"There is already a team in the quest room.")     ---- mesagem caso exista alguem no 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

 

 Configure a gosto @trancx123

Atenciosamente,

 0lxhEI2.jpg

 

 

Meu servidor:

 

pbOT

Postado
  • Autor
1 hora atrás, Ragnar Lothbrook disse:
  Ocultar conteúdo


local room = { -- room with demons
        fromX = 1648,      ---- canto superior esquerdo da sala ( incluir a sala toda, inclusive a parte dos baus)
        fromY = 1786,
        fromZ = 6,
      
		toX = 1655, ---- canto inferior direito da sala
        toY = 1794,
        toZ = 6
        }

        
local monster_pos = { -- posição dos monstros
        
[1] = {pos = {1650, 1788, 6}, monster = "Demon"},      
[2] = {pos = {1651, 1792, 6}, monster = "Demon"},       
[3] = {pos = {1652, 1788, 6}, monster = "Demon"},       
[4] = {pos = {1653, 1792, 6}, monster = "Demon"},       
[5] = {pos = {1654, 1790, 6}, monster = "Demon"},       
[6] = {pos = {1655, 1790, 6}, monster = "Orshabaal"}
        }

        
local players_pos = {          ---- posição onde os players devem estar
{x = 1019, y = 1542, z = 6, stackpos = 253},       
{x = 1018, y = 1542, z = 6, stackpos = 253},      
{x = 1017, y = 1542, z = 6, stackpos = 253},       
{x = 1016, y = 1542, z = 6, stackpos = 253}
}

        

local new_player_pos = { --- posição para onde irao ao puxar alavanca
        
{x = 1653, y = 1790, z = 6},        
{x = 1652, y = 1790, z = 6},        
{x = 1651, y = 1790, z = 6},        
{x = 1650, y = 1790, z = 6}
}

        

local playersOnly = "yes" -- yes- apenas players. no- monstros como summons tambem podem substituir um local vazio
        
local questLevel = 100  --- level necessario para entrar na quest, checado pela alavanca

     
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                                        
local door = getTileItemById({x=1656, y=1790, z=6}, 5109).uid	----- posição da porta apos o segundo monstro				
if door > 0 then						
doTransformItem(door, 5108)					
end

										
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[i], FALSE)                                             
doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA)                                               
doTransformItem(item.uid,1946)                                       
end                               
else                                       
doPlayerSendTextMessage(cid,22,"Only players can do this quest.")               --- mensagem caso o OnlyPlayers esteja YES, e existe um summmon na pos                 
end                       
else                               
doPlayerSendTextMessage(cid,22,"All Players have to be level "..questLevel.." to do this quest.")      --- mensagem caso player nao tenha level                  
end               
else                       
doPlayerSendTextMessage(cid,22,"You need "..table.getn(players_pos).." players to do this quest.")       ----- mensagem caso falte players         
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,22,"There is already a team in the quest room.")     ---- mesagem caso exista alguem no 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

 

 Não tenho palavras para te agradecer ragnar! funcionou certinho de primeiro! quando um script é bom e bem organizado fica até facil! BRIGADAO! REP+

 

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.6k

Informação Importante

Confirmação de Termo