Ir para conteúdo

Featured Replies

Postado

Estou tendo problemas para criar essa script, funciona da seguinte forma voce matara os monstros na ordem declara:

 

Matei o raditz, agora so posso matar o vegeta, caso tente matar  o raditz novamente da uma mensagem de erro , assim pra todas se eu tiver na 1 missao pra matar raditz e tenta matar vegeta da mensagem de erro.

 

 

 

 

@xWhiteWolf , @Vodkart

 

codigo que fiz, ta dando pra atacar os monstros anteriores :(

 

 

 

 

 

 

 

 


local mtrs = {
 
                ["[SAGA] RADITZ"] = {storage = 3 },
                ["[SAGA] VEGETA"] = {storage = 2 },
              
}

function onTarget(cid, target)
for name, v in pairs(mtrs) do
    if isMonster(cid) and isPlayer(target) then
        if getPlayerStorageValue(cid,98000) ~= v.storage then
            return false
        end
    elseif isPlayer(cid) and isMonster(target) then
        if getCreatureName(target) == name and getPlayerStorageValue(cid,98000) ~= v.storage then     
            return doPlayerSendCancel(cid, "você não pode atacar esta criatura.") and false
        end
    end
    return true
end

end


function onStatsChange(cid, attacker, type, combat, value)
for name, v in pairs(mtrs) do
    if isMonster(attacker) and getCreatureName(attacker) == name and isPlayer(cid) then
        if getPlayerStorageValue(cid, 98000) == v.storage then
            return false
        end
    elseif isPlayer(attacker) and isMonster(cid) and type == STATSCHANGE_HEALTHLOSS then
      local new = v.storage-1
        if getCreatureName(target) == name and getPlayerStorageValue(cid,98000) == new then     
           return doPlayerSendCancel(attacker, "You cannot attack this monster now.") and false
        end
    end
    return true
end
end

function onDeath(cid, corpse, killer)
local tps = {
   
    ["[SAGA] RADITZ"] = {stor=1, nv="raditz"},
    ["[SAGA] VEGETA"] = {stor=2, nv="vegeta"},
}
 local tp = tps[getCreatureName(cid)]
    if tp then
doCreatureSay(cid, "[SAGA COMPLETA].", TALKTYPE_ORANGE_1)
if isInParty(killer[1]) == TRUE then
local players = getPartyMembers(getPartyLeader(killer[1]))
for i, k in ipairs(players) do
setPlayerStorageValue(k,98000, tp.stor+1)
end
else
setPlayerStorageValue(killer[1], 98000, tp.stor+1)
end 
return TRUE
end
end


function onCombat(cid, target)
for name, v in pairs(mtrs) do
if isPlayer(cid) and getCreatureStorage(cid, 98000) < v.storage and isMonster(target) and getCreatureName(target):lower() == name then
doPlayerSendCancel(cid, 'You cannot attack this monster.')
return false
end 
if isMonster(cid) and getCreatureName(cid):lower() == name and isPlayer(target) and getCreatureStorage(target, storage) < v.storage then
return false
end
return true
end    
end

 

Editado por Gustavo BRX (veja o histórico de edições)

Postado

tbm quero

esse system e tipo saga? tipo vc mata raditiz dps fala saga e vc tem uma nova missao?

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

Postado

e existe um monstro com o nome "[SAGA] RADITZ" mesmo? kk

 

local mtrs = {
	["[SAGA] RADITZ"] = {storage = 3},
	["[SAGA] VEGETA"] = {storage = 2} 
}
function onCombat(cid, target)
	if isPlayer(cid) and isMonster(target) then
		local s = getCreatureStorage(cid, 98000) < 0 and 0 or getCreatureStorage(cid, 98000) 
		for name, v in pairs(mtrs) do
			if getCreatureName(target):lower() == name:lower() and s ~= v.storage then
				doPlayerSendCancel(cid, 'You cannot attack this monster.')
				return false
			end 
		end
	end
	return true 
end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

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