Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Ola galera, venho pedir uma ajuda de vocês.

Tem um evento em meu servidor, que quem dar o último golpe no monstro pega uma storage, imagem no final do tópico. Bom, só que tem 1 problema, ao invez de toda a guild ganhar o evento, apenas 1 pessoa está ganhando, queria que tipo: 1 membro da guild Alkaeda deu o ultimo golpe, sendo assim todos ganharão. Vlw aí e dou Rep+ para quem me ajudar.

SCRIPT:

Spoiler

local events = {}
function onLogin(cid) 
 if (getPlayerStorageValue(cid, GRANTOWER.AURA) ~= -1) then
  if getGlobalStorageValue(GRANTOWER.SAVELASTWINNER) ~= getCreatureName(cid) then
   if (getPlayerGuildId(cid) ~= getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID)) then
    setPlayerStorageValue(cid, GRANTOWER.AURA, -1)
   end
  end
  local event = addEvent(function()
     if isCreature(cid) then
     changeOutfit(cid)
     end
 end, 0)
  events[cid] = event
 end 
 return true
end
 
function onLogout(cid) 
 if (getGlobalStorageValue(GRANTOWER.FINALWINNER) == getCreatureName(cid)) then
  doPlayerSendCancel(cid, "You cannot logout while Gran Tower is running.")
  return false
 end
 if events[cid] then
  stopEvent(events[cid])
 end
 return true
end

function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isCreature(attacker) and (not (attacker == cid)) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then
        if getGlobalStorageValue(GRANTOWER.SAVELASTWINNER) ~= getCreatureName(cid) and getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID) ~= getPlayerGuildId(cid) then
                return true
        end
        
        value = value - (math.ceil(value*(GRANTOWER.AURAPERCENT)))
        doTargetCombatHealth(cid, attacker, type, -value, -value, 255)
        doCreatureAddHealth(cid, value)
        return true
    end
return true
end

Imagem:

 

Sem título.png

Postado
3 horas atrás, Sardouzerah disse:

Ola galera, venho pedir uma ajuda de vocês.

Tem um evento em meu servidor, que quem dar o último golpe no monstro pega uma storage, imagem no final do tópico. Bom, só que tem 1 problema, ao invez de toda a guild ganhar o evento, apenas 1 pessoa está ganhando, queria que tipo: 1 membro da guild Alkaeda deu o ultimo golpe, sendo assim todos ganharão. Vlw aí e dou Rep+ para quem me ajudar.

SCRIPT:

  Mostrar conteúdo oculto

local events = {}
function onLogin(cid) 
 if (getPlayerStorageValue(cid, GRANTOWER.AURA) ~= -1) then
  if getGlobalStorageValue(GRANTOWER.SAVELASTWINNER) ~= getCreatureName(cid) then
   if (getPlayerGuildId(cid) ~= getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID)) then
    setPlayerStorageValue(cid, GRANTOWER.AURA, -1)
   end
  end
  local event = addEvent(function()
     if isCreature(cid) then
     changeOutfit(cid)
     end
 end, 0)
  events[cid] = event
 end 
 return true
end
 
function onLogout(cid) 
 if (getGlobalStorageValue(GRANTOWER.FINALWINNER) == getCreatureName(cid)) then
  doPlayerSendCancel(cid, "You cannot logout while Gran Tower is running.")
  return false
 end
 if events[cid] then
  stopEvent(events[cid])
 end
 return true
end

function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isCreature(attacker) and (not (attacker == cid)) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then
        if getGlobalStorageValue(GRANTOWER.SAVELASTWINNER) ~= getCreatureName(cid) and getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID) ~= getPlayerGuildId(cid) then
                return true
        end
        
        value = value - (math.ceil(value*(GRANTOWER.AURAPERCENT)))
        doTargetCombatHealth(cid, attacker, type, -value, -value, 255)
        doCreatureAddHealth(cid, value)
        return true
    end
return true
end

Imagem:

 

Sem título.png

Falta alguma parte ou algum outro script, o que você passou não tem a parte de matar o monstro ou algo relacionado.

Vai ser um OnDeath ou um OnKill provavelmente.

asdukeeh.jpg

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