Postado Abril 8, 2017 8 anos 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 Abril 8, 2017 8 anos por Gustavo BRX (veja o histórico de edições)
Postado Abril 8, 2017 8 anos 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 Abril 9, 2017 8 anos Autor 10 horas atrás, ZikaLord disse: tbm quero esse system e tipo saga? tipo vc mata raditiz dps fala saga e vc tem uma nova missao? È foda ninguem ajuda , fique 4hrs montando e corrigindo esse codigo e não consegui terminar e ninguem do tk ajuda
Postado Abril 12, 2017 8 anos 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 [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#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.