Ir para conteúdo
  • Cadastre-se

(Resolvido)[AJUDA] Preciso de ajuda nesse script


Ir para solução Resolvido por zipter98,

Posts Recomendados

local config = {
storage984 = STORAGE,
storage985 = STORAGE
}
 
local magePositions = {
Position(33328, 31859, 9),
Position(33367, 31873, 9),
Position(33349, 31899, 9)
}
 
local positions = {
Position(33313, 31852, 9),
Position(33313, 31865, 9),
Position(33313, 31881, 9),
Position(33328, 31860, 9),
Position(33328, 31873, 9),
Position(33328, 31885, 9),
Position(33308, 31873, 9),
Position(33320, 31873, 9),
Position(33335, 31873, 9),
Position(33360, 31873, 9),
Position(33336, 31914, 9),
Position(33343, 31914, 9),
Position(33353, 31914, 9),
Position(33361, 31914, 9),
Position(33345, 31900, 9),
Position(33352, 31900, 9),
Position(33355, 31854, 9),
Position(33355, 31861, 9),
Position(33355, 31885, 9),
Position(33345, 31864, 9),
Position(33345, 31881, 9),
Position(33309, 31867, 9),
Position(33317, 31879, 9),
Position(33311, 31854, 9),
Position(33334, 31889, 9),
Position(33340, 31890, 9),
Position(33347, 31889, 9)
}
 
local servants = {
'iron servant',
'golden servant',
'diamond servant'
}
 
local function fillFungus(fromPosition, toPosition)
for x = fromPosition.x, toPosition.x do
for y = fromPosition.y, toPosition.y do
local position = Position(x, y, 9)
local tile = Tile(position)
if tile then
local item = tile:getItemById(13590)
if item then
item:transform(math.random(13585, 13589))
position:sendMagicEffect(CONST_ME_YELLOW_RINGS)
end
end
end
end
end
 
local function summonServant(position)
Game.createMonster(servants[math.random(#servants)], position)
position:sendMagicEffect(CONST_ME_TELEPORT)
end
 
function onKill(cid, target)
local targetMonster = Monster(target)
if not targetMonster then
return true
end
 
if not isInArray(servants, getCreatureName(target):lower()) then
return true
end
 
local storage984, storage985 = getGlobalStorageValue(984), getGlobalStorageValue(985)
if storage985 == #positions and storage984 < 25 then
setGlobalStorageValue(985, 0)
setGlobalStorageValue(984, storage + 1)
 
for i = 1, #positions do
addEvent(summonServant, 5 * 1000, positions)
end
 
elseif storage985 < #positions and storage984 < 25 then
setGlobalStorageValue(985, storage985 + 1)
 
elseif storage985 == #positions and storage984 == 25 then
Game.createMonster('mad mage', magePositions[math.random(#magePositions)])
targetMonster:say('The Mad Mage has been spawned!', TALKTYPE_MONSTER_SAY)
fillFungus({x = 33306, y = 31847}, {x = 33369, y = 31919})
end
return true
end

Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais...

________________________________________________________________________________

Minhas Sprites:

Mega Metagross

Mega Abomasnow

Pack de Shinys

[Posso atualizá-lo com novos shinys a qualquer momento]

Tutoriais:

[Completo] Criando e adicionando um novo Pokémon

[Actions] Criando quest no RME

Editores Lua/Xml/Sync Entre outros:

Editores Win/Mac/Linux

Link para o post
Compartilhar em outros sites
  • Respostas 11
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Troque: setGlobalStorageValue(984, storage + 1) por: setGlobalStorageValue(984, storage984 + 1)

De nada. Quando o pedido é resolvido (ou a dúvida sanada), é recomendado que você selecione como "Melhor Resposta" aquela que lhe mais ajudou. Assim, o tópico fica destacado com o prefixo "Resolvido".

  • Solução

Troque:

setGlobalStorageValue(984, storage + 1)

por:

setGlobalStorageValue(984, storage984 + 1)
Editado por zipter98 (veja o histórico de edições)

não respondo pms solicitando suporte em programação/scripting

Link para o post
Compartilhar em outros sites

 

Troque:

setGlobalStorageValue(984, storage + 1)

por:

setGlobalStorageValue(984, storage984 + 1)

 

Valeu, funcionou aquii!!

 

local config = {
storage984 = STORAGE,
storage985 = STORAGE
}
 
local magePositions = {
Position(33328, 31859, 9),
Position(33367, 31873, 9),
Position(33349, 31899, 9)
}
 
local positions = {
Position(33313, 31852, 9),
Position(33313, 31865, 9),
Position(33313, 31881, 9),
Position(33328, 31860, 9),
Position(33328, 31873, 9),
Position(33328, 31885, 9),
Position(33308, 31873, 9),
Position(33320, 31873, 9),
Position(33335, 31873, 9),
Position(33360, 31873, 9),
Position(33336, 31914, 9),
Position(33343, 31914, 9),
Position(33353, 31914, 9),
Position(33361, 31914, 9),
Position(33345, 31900, 9),
Position(33352, 31900, 9),
Position(33355, 31854, 9),
Position(33355, 31861, 9),
Position(33355, 31885, 9),
Position(33345, 31864, 9),
Position(33345, 31881, 9),
Position(33309, 31867, 9),
Position(33317, 31879, 9),
Position(33311, 31854, 9),
Position(33334, 31889, 9),
Position(33340, 31890, 9),
Position(33347, 31889, 9)
}
 
local servants = {
'iron servant',
'golden servant',
'diamond servant'
}
 
local function fillFungus(fromPosition, toPosition)
for x = fromPosition.x, toPosition.x do
for y = fromPosition.y, toPosition.y do
local position = Position(x, y, 9)
local tile = Tile(position)
if tile then
local item = tile:getItemById(13590)
if item then
item:transform(math.random(13585, 13589))
position:sendMagicEffect(CONST_ME_YELLOW_RINGS)
end
end
end
end
end
 
local function summonServant(position)
Game.createMonster(servants[math.random(#servants)], position)
position:sendMagicEffect(CONST_ME_TELEPORT)
end
 
function onKill(cid, target)
local targetMonster = Monster(target)
if not targetMonster then
return true
end
 
if not isInArray(servants, getCreatureName(target):lower()) then
return true
end
 
local storage984, storage985 = getGlobalStorageValue(984), getGlobalStorageValue(985)
if storage985 == #positions and storage984 < 25 then
setGlobalStorageValue(985, 0)
setGlobalStorageValue(984, storage + 1)
 
for i = 1, #positions do
addEvent(summonServant, 5 * 1000, positions)
end
 
elseif storage985 < #positions and storage984 < 25 then
setGlobalStorageValue(985, storage985 + 1)
 
elseif storage985 == #positions and storage984 == 25 then
Game.createMonster('mad mage', magePositions[math.random(#magePositions)])
targetMonster:say('The Mad Mage has been spawned!', TALKTYPE_MONSTER_SAY)
fillFungus({x = 33306, y = 31847}, {x = 33369, y = 31919})
end
return true
end

 

Obrigado tambem, esse tambem funcionou! Podem fechar o topico, problema resolvido!

Link para o post
Compartilhar em outros sites

De nada. Quando o pedido é resolvido (ou a dúvida sanada), é recomendado que você selecione como "Melhor Resposta" aquela que lhe mais ajudou. Assim, o tópico fica destacado com o prefixo "Resolvido".

não respondo pms solicitando suporte em programação/scripting

Link para o post
Compartilhar em outros sites

Nada rs, qualquer coisa estou aqui pode chamar  ^^

Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais...

________________________________________________________________________________

Minhas Sprites:

Mega Metagross

Mega Abomasnow

Pack de Shinys

[Posso atualizá-lo com novos shinys a qualquer momento]

Tutoriais:

[Completo] Criando e adicionando um novo Pokémon

[Actions] Criando quest no RME

Editores Lua/Xml/Sync Entre outros:

Editores Win/Mac/Linux

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Estatísticas dos Fóruns

    96845
    Tópicos
    519598
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo