Postado Maio 26, 2016 9 anos Autor 3 minutos atrás, Talesigorvr disse: if isMC (cid) and isInArray (config.monster, getCreatureName (target)) then Ficaria aonde? Tentei trocar aqui sozinho mas acabou dando um errorzinho. Citar local config = { monster = {"Amon", "Basilisco","Azazel"}, -- nome dos monstros, separado por vírgulas. item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3... qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3... effect = 27, -- efeito ao matar o monstro. } local function isMC (cid) for _, pid in ipairs(getPlayersOnline()) do if cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid) then return false end end return true end function onKill(cid, target) if isMC (cid) then if isInArray(config.monster, getCreatureName(target)) then for i = 1, #config.item do doPlayerAddItem (cid, config.item, config.qnt) end doPlayerSendTextMessage (cid, 19, "You will receive a reward for defeating the "..getCreatureName(target)..".") doSendMagicEffect (getThingPos (cid), config.effect) end else doPlayerSendTextMessage (cid, 19, "You will not receive a reward for is Multi-Client.") end return true end
Postado Maio 26, 2016 9 anos local config = { monster = {"Amon", "Basilisco","Azazel"}, -- nome dos monstros, separado por vírgulas. item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3... qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3... effect = 27, -- efeito ao matar o monstro. } local function isMC (cid) for _, pid in ipairs(getPlayersOnline()) do if cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid) then return false end end return true end function onKill(cid, target) if isInArray (config.monster, getCreatureName (target)) then if isMC (cid) then for i = 1, #config.item do doPlayerAddItem (cid, config.item, config.qnt) end doPlayerSendTextMessage (cid, 19, "You will receive a reward for defeating the "..getCreatureName(target)..".") doSendMagicEffect (getThingPos (cid), config.effect) else doPlayerSendTextMessage (cid, 19, "You will not receive a reward for is Multi-Client.") end end return true end Editado Maio 26, 2016 9 anos por Talesigorvr (veja o histórico de edições) Não dou suporte via PM, crie um tópico caso tenha dúvidas. Isso previne que outras pessoas com a mesma dúvida criem tópicos desnecessários.
Postado Maio 26, 2016 9 anos Autor 25 minutos atrás, Talesigorvr disse: local config = { monster = {"Amon", "Basilisco","Azazel"}, -- nome dos monstros, separado por vírgulas. item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3... qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3... effect = 27, -- efeito ao matar o monstro. } local function isMC (cid) for _, pid in ipairs(getPlayersOnline()) do if cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid) then return false end end return true end function onKill(cid, target) if isMC (cid) and isInArray (config.monster, getCreatureName (target)) then for i = 1, #config.item do doPlayerAddItem (cid, config.item, config.qnt) end doPlayerSendTextMessage (cid, 19, "You will receive a reward for defeating the "..getCreatureName(target)..".") doSendMagicEffect (getThingPos (cid), config.effect) else doPlayerSendTextMessage (cid, 19, "You will not receive a reward for is Multi-Client.") end return true end Continua a msm coisa, ao matar algum dos bosses com MC, ele bloqueia a recompensa e manda a msg (Ate ai normal). Mas qud eu mato um Wasp ou Player, ele manda a msg. @Talesigorvr Mano nao sei se tem algo haver, mas vou mandar meu OnKill (Nao sei se pode ser isso que esteja fazendo acontecer) Citar function onKill(cid, target) --config---------------------------- local lvl = getPlayerLevel(cid) --players level local nlvl = getPlayerLevel(cid) + 5 -- add 5 levels --end------------------------------- if isPlayer(target) == TRUE then if getPlayerIp(cid) ~= getPlayerIp(target) then local exp = (50 * (lvl) * (lvl) * (lvl) - 150 * (lvl) * (lvl) + 400 * (lvl)) / 5 local nexp = (50 * (nlvl) * (nlvl) * (nlvl) - 150 * (nlvl) * (nlvl) + 400 * (nlvl)) / 5 local newexp = nexp - exp doPlayerAddExp(cid,newexp) doSendAnimatedText(getPlayerPosition(cid), "Orgasmic~", 198) else doPlayerAddExperience(cid, -50000) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.") end end return TRUE end
Postado Maio 26, 2016 9 anos Editei o comentário com o código, teste novamente. Não dou suporte via PM, crie um tópico caso tenha dúvidas. Isso previne que outras pessoas com a mesma dúvida criem tópicos desnecessários.
Postado Maio 26, 2016 9 anos Autor 19 minutos atrás, Talesigorvr disse: Editei o comentário com o código, teste novamente. Desculpa esta incomadando novamente mas nada ainda... continuo a mesma coisa. Editado Maio 26, 2016 9 anos por caioitalo1 (veja o histórico de edições)
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.