Postado Setembro 18, 2015 9 anos Substitui o script por este Mostrar conteúdo oculto local config = { protectZone = "sim", -- Precisa estar em PZ para usar o comando? skill = { item = 9971, -- Item removido quantidade = 10, -- Quantidade quantidadeskill = 10, -- Skill adicionada limiteskill = 350 -- Limite }, magicLevel = { item = 9971, -- Item removido quantidade = 15, -- Quantidade quantidademl = 5, -- Magic level adicionado limitedeml = 200 -- Limite }, skillID = { -- ID das skills ["club"] = SKILL_CLUB, ["sword"]= SKILL_SWORD, ["axe"] = SKILL_AXE, ["distance"] = SKILL_DISTANCE, ["shielding"] = SKILL_SHIELD }, vocationSkill = { -- Vocações que pode comprar x skill ["club"] = {4, 8}, ["sword"] = {4, 8}, ["axe"] = {4, 8}, ["distance"] = {3, 7}, ["shielding"] = {4, 8} }, vocationMagicLevel = {1, 2, 5, 6}, -- Vocações que pode comprar magic level delay = { skill = { storage = 45, duration = 5 -- Tempo para comprar skill novamente }, magicLevel = { storage = 97, duration = 5 -- Tempo para comprar magic level novamente } } } function onSay(cid, words, param, channel) local playerId = getPlayerGUID(cid) if config.protectZone == "sim" and not getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "Você precisa estar em protection zone para comprar.") end if param == "magiclevel" then if getPlayerMagLevel(cid) < config.magicLevel.limitedeml then if isInArray(config.vocationMagicLevel, getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, config.magicLevel.item, config.magicLevel.quantidade) then if (os.time() - getPlayerStorageValue(cid, config.delay.magicLevel.storage)) >= config.delay.magicLevel.duration then setPlayerStorageValue(cid, config.delay.magicLevel.storage, os.time()) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `maglevel` = `maglevel` + " .. config.magicLevel.quantidademl .. " WHERE `id` = " .. playerId) else doPlayerSendCancel(cid, "Espere " .. config.delay.magicLevel.duration .. " segundos para comprar novamente.") end else doPlayerSendCancel(cid, "Você não tem o item requerido.") end else doPlayerSendCancel(cid, "Voce não pode comprar magic level.") end else doPlayerSendCancel(cid, "Você chegou no limite de magic level.") end elseif config.skillID[string.lower(param)] then if getPlayerSkill(cid, config.skillID[string.lower(param)]) < config.skill.limiteskill then if isInArray(config.vocationSkill[string.lower(param)], getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, config.skill.item, config.skill.quantidade) then if (os.time() - getPlayerStorageValue(cid, config.delay.skill.storage)) >= config.delay.skill.duration then setPlayerStorageValue(cid, config.delay.skill.storage, os.time()) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `skill_sword` = `skill_sword` + " .. config.skill.quantidadeskill .. " WHERE `player_id` = " .. playerId .. " and `skillid` = " .. config.skillID[string.lower(param)]) db.query("UPDATE `players` SET `skill_axe` = `skill_axe` + " .. config.skill.quantidadeskill .. " WHERE `player_id` = " .. playerId .. " and `skillid` = " .. config.skillID[string.lower(param)]) db.query("UPDATE `players` SET `skill_club` = `skill_club` + " .. config.skill.quantidadeskill .. " WHERE `player_id` = " .. playerId .. " and `skillid` = " .. config.skillID[string.lower(param)]) db.query("UPDATE `players` SET `skill_dist` = `skill_dist` + " .. config.skill.quantidadeskill .. " WHERE `player_id` = " .. playerId .. " and `skillid` = " .. config.skillID[string.lower(param)]) else doPlayerSendCancel(cid, "Espere " .. config.delay.skill.duration .. " segundos para comprar novamente.") end else doPlayerSendCancel(cid, "Você não tem o item requerido.") end else doPlayerSendCancel(cid, "Voce não pode comprar este skill.") end else doPlayerSendCancel(cid, "Você chegou no limite de skill.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Possíveis parâmetros: club, sword, axe, distance, shielding, magiclevel.") end return true end
Postado Setembro 18, 2015 9 anos Autor Em 18/09/2015 em 02:50, peckface disse: Substitui o script por este Mostrar conteúdo oculto Mostrar conteúdo oculto local config = { protectZone = "sim", -- Precisa estar em PZ para usar o comando? skill = { item = 9971, -- Item removido quantidade = 10, -- Quantidade quantidadeskill = 10, -- Skill adicionada limiteskill = 350 -- Limite }, magicLevel = { item = 9971, -- Item removido quantidade = 15, -- Quantidade quantidademl = 5, -- Magic level adicionado limitedeml = 200 -- Limite }, skillID = { -- ID das skills ["club"] = SKILL_CLUB, ["sword"]= SKILL_SWORD, ["axe"] = SKILL_AXE, ["distance"] = SKILL_DISTANCE, ["shielding"] = SKILL_SHIELD }, vocationSkill = { -- Vocações que pode comprar x skill ["club"] = {4, 8}, ["sword"] = {4, 8}, ["axe"] = {4, 8}, ["distance"] = {3, 7}, ["shielding"] = {4, 8} }, vocationMagicLevel = {1, 2, 5, 6}, -- Vocações que pode comprar magic level delay = { skill = { storage = 45, duration = 5 -- Tempo para comprar skill novamente }, magicLevel = { storage = 97, duration = 5 -- Tempo para comprar magic level novamente } } } function onSay(cid, words, param, channel) local playerId = getPlayerGUID(cid) if config.protectZone == "sim" and not getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "Você precisa estar em protection zone para comprar.") end if param == "magiclevel" then if getPlayerMagLevel(cid) < config.magicLevel.limitedeml then if isInArray(config.vocationMagicLevel, getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, config.magicLevel.item, config.magicLevel.quantidade) then if (os.time() - getPlayerStorageValue(cid, config.delay.magicLevel.storage)) >= config.delay.magicLevel.duration then setPlayerStorageValue(cid, config.delay.magicLevel.storage, os.time()) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `maglevel` = `maglevel` + " .. config.magicLevel.quantidademl .. " WHERE `id` = " .. playerId) else doPlayerSendCancel(cid, "Espere " .. config.delay.magicLevel.duration .. " segundos para comprar novamente.") end else doPlayerSendCancel(cid, "Você não tem o item requerido.") end else doPlayerSendCancel(cid, "Voce não pode comprar magic level.") end else doPlayerSendCancel(cid, "Você chegou no limite de magic level.") end elseif config.skillID[string.lower(param)] then if getPlayerSkill(cid, config.skillID[string.lower(param)]) < config.skill.limiteskill then if isInArray(config.vocationSkill[string.lower(param)], getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, config.skill.item, config.skill.quantidade) then if (os.time() - getPlayerStorageValue(cid, config.delay.skill.storage)) >= config.delay.skill.duration then setPlayerStorageValue(cid, config.delay.skill.storage, os.time()) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `skill_sword` = `skill_sword` + " .. config.skill.quantidadeskill .. " WHERE `player_id` = " .. playerId .. " and `skillid` = " .. config.skillID[string.lower(param)]) db.query("UPDATE `players` SET `skill_axe` = `skill_axe` + " .. config.skill.quantidadeskill .. " WHERE `player_id` = " .. playerId .. " and `skillid` = " .. config.skillID[string.lower(param)]) db.query("UPDATE `players` SET `skill_club` = `skill_club` + " .. config.skill.quantidadeskill .. " WHERE `player_id` = " .. playerId .. " and `skillid` = " .. config.skillID[string.lower(param)]) db.query("UPDATE `players` SET `skill_dist` = `skill_dist` + " .. config.skill.quantidadeskill .. " WHERE `player_id` = " .. playerId .. " and `skillid` = " .. config.skillID[string.lower(param)]) else doPlayerSendCancel(cid, "Espere " .. config.delay.skill.duration .. " segundos para comprar novamente.") end else doPlayerSendCancel(cid, "Você não tem o item requerido.") end else doPlayerSendCancel(cid, "Voce não pode comprar este skill.") end else doPlayerSendCancel(cid, "Você chegou no limite de skill.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Possíveis parâmetros: club, sword, axe, distance, shielding, magiclevel.") end return true end deu o mesmo erro ;(
Postado Setembro 18, 2015 9 anos ve agora substitui por esse aqui Mostrar conteúdo oculto local config = { protectZone = "sim", -- Precisa estar em PZ para usar o comando? skill = { item = 9971, -- Item removido quantidade = 10, -- Quantidade quantidadeskill = 10, -- Skill adicionada limiteskill = 350 -- Limite }, magicLevel = { item = 9971, -- Item removido quantidade = 15, -- Quantidade quantidademl = 5, -- Magic level adicionado limitedeml = 200 -- Limite }, skillID = { -- ID das skills ["club"] = SKILL_CLUB, ["sword"]= SKILL_SWORD, ["axe"] = SKILL_AXE, ["distance"] = SKILL_DISTANCE, ["shielding"] = SKILL_SHIELD }, vocationSkill = { -- Vocações que pode comprar x skill ["club"] = {4, 8}, ["sword"] = {4, 8}, ["axe"] = {4, 8}, ["distance"] = {3, 7}, ["shielding"] = {4, 8} }, vocationMagicLevel = {1, 2, 5, 6}, -- Vocações que pode comprar magic level delay = { skill = { storage = 45, duration = 5 -- Tempo para comprar skill novamente }, magicLevel = { storage = 97, duration = 5 -- Tempo para comprar magic level novamente } } } function onSay(cid, words, param, channel) local playerId = getPlayerGUID(cid) if config.protectZone == "sim" and not getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "Você precisa estar em protection zone para comprar.") end if param == "magiclevel" then if getPlayerMagLevel(cid) < config.magicLevel.limitedeml then if isInArray(config.vocationMagicLevel, getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, config.magicLevel.item, config.magicLevel.quantidade) then if (os.time() - getPlayerStorageValue(cid, config.delay.magicLevel.storage)) >= config.delay.magicLevel.duration then setPlayerStorageValue(cid, config.delay.magicLevel.storage, os.time()) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `maglevel` = `maglevel` + " .. config.magicLevel.quantidademl .. " WHERE `id` = " .. playerId) else doPlayerSendCancel(cid, "Espere " .. config.delay.magicLevel.duration .. " segundos para comprar novamente.") end else doPlayerSendCancel(cid, "Você não tem o item requerido.") end else doPlayerSendCancel(cid, "Voce não pode comprar magic level.") end else doPlayerSendCancel(cid, "Você chegou no limite de magic level.") end elseif config.skillID[string.lower(param)] then if getPlayerSkill(cid, config.skillID[string.lower(param)]) < config.skill.limiteskill then if isInArray(config.vocationSkill[string.lower(param)], getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, config.skill.item, config.skill.quantidade) then if (os.time() - getPlayerStorageValue(cid, config.delay.skill.storage)) >= config.delay.skill.duration then setPlayerStorageValue(cid, config.delay.skill.storage, os.time()) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `skill_sword` = `skill_sword` + " .. config.skill.quantidadeskill .. " WHERE `id` = " .. playerId) db.query("UPDATE `players` SET `skill_axe` = `skill_axe` + " .. config.skill.quantidadeskill .. " WHERE `id` = " .. playerId) db.query("UPDATE `players` SET `skill_club` = `skill_club` + " .. config.skill.quantidadeskill .. " WHERE `id` = " .. playerId) db.query("UPDATE `players` SET `skill_dist` = `skill_dist` + " .. config.skill.quantidadeskill .. " WHERE `id` = " .. playerId) else doPlayerSendCancel(cid, "Espere " .. config.delay.skill.duration .. " segundos para comprar novamente.") end else doPlayerSendCancel(cid, "Você não tem o item requerido.") end else doPlayerSendCancel(cid, "Voce não pode comprar este skill.") end else doPlayerSendCancel(cid, "Você chegou no limite de skill.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Possíveis parâmetros: club, sword, axe, distance, shielding, magiclevel.") end return true end
Postado Setembro 18, 2015 9 anos Autor Em 18/09/2015 em 03:03, peckface disse: ve agora substitui por esse aqui Mostrar conteúdo oculto Mostrar conteúdo oculto local config = { protectZone = "sim", -- Precisa estar em PZ para usar o comando? skill = { item = 9971, -- Item removido quantidade = 10, -- Quantidade quantidadeskill = 10, -- Skill adicionada limiteskill = 350 -- Limite }, magicLevel = { item = 9971, -- Item removido quantidade = 15, -- Quantidade quantidademl = 5, -- Magic level adicionado limitedeml = 200 -- Limite }, skillID = { -- ID das skills ["club"] = SKILL_CLUB, ["sword"]= SKILL_SWORD, ["axe"] = SKILL_AXE, ["distance"] = SKILL_DISTANCE, ["shielding"] = SKILL_SHIELD }, vocationSkill = { -- Vocações que pode comprar x skill ["club"] = {4, 8}, ["sword"] = {4, 8}, ["axe"] = {4, 8}, ["distance"] = {3, 7}, ["shielding"] = {4, 8} }, vocationMagicLevel = {1, 2, 5, 6}, -- Vocações que pode comprar magic level delay = { skill = { storage = 45, duration = 5 -- Tempo para comprar skill novamente }, magicLevel = { storage = 97, duration = 5 -- Tempo para comprar magic level novamente } } } function onSay(cid, words, param, channel) local playerId = getPlayerGUID(cid) if config.protectZone == "sim" and not getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "Você precisa estar em protection zone para comprar.") end if param == "magiclevel" then if getPlayerMagLevel(cid) < config.magicLevel.limitedeml then if isInArray(config.vocationMagicLevel, getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, config.magicLevel.item, config.magicLevel.quantidade) then if (os.time() - getPlayerStorageValue(cid, config.delay.magicLevel.storage)) >= config.delay.magicLevel.duration then setPlayerStorageValue(cid, config.delay.magicLevel.storage, os.time()) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `maglevel` = `maglevel` + " .. config.magicLevel.quantidademl .. " WHERE `id` = " .. playerId) else doPlayerSendCancel(cid, "Espere " .. config.delay.magicLevel.duration .. " segundos para comprar novamente.") end else doPlayerSendCancel(cid, "Você não tem o item requerido.") end else doPlayerSendCancel(cid, "Voce não pode comprar magic level.") end else doPlayerSendCancel(cid, "Você chegou no limite de magic level.") end elseif config.skillID[string.lower(param)] then if getPlayerSkill(cid, config.skillID[string.lower(param)]) < config.skill.limiteskill then if isInArray(config.vocationSkill[string.lower(param)], getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, config.skill.item, config.skill.quantidade) then if (os.time() - getPlayerStorageValue(cid, config.delay.skill.storage)) >= config.delay.skill.duration then setPlayerStorageValue(cid, config.delay.skill.storage, os.time()) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `skill_sword` = `skill_sword` + " .. config.skill.quantidadeskill .. " WHERE `id` = " .. playerId) db.query("UPDATE `players` SET `skill_axe` = `skill_axe` + " .. config.skill.quantidadeskill .. " WHERE `id` = " .. playerId) db.query("UPDATE `players` SET `skill_club` = `skill_club` + " .. config.skill.quantidadeskill .. " WHERE `id` = " .. playerId) db.query("UPDATE `players` SET `skill_dist` = `skill_dist` + " .. config.skill.quantidadeskill .. " WHERE `id` = " .. playerId) else doPlayerSendCancel(cid, "Espere " .. config.delay.skill.duration .. " segundos para comprar novamente.") end else doPlayerSendCancel(cid, "Você não tem o item requerido.") end else doPlayerSendCancel(cid, "Voce não pode comprar este skill.") end else doPlayerSendCancel(cid, "Você chegou no limite de skill.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Possíveis parâmetros: club, sword, axe, distance, shielding, magiclevel.") end return true end Então deu certo agora, mas eu compro 1 skill. exemplo compro skill axe ele adiciona 10 skill em sword, club, axe, distance, shielding.
Postado Setembro 18, 2015 9 anos Solução Foi mal esqueci de fechar a função, agora vai Mostrar conteúdo oculto local config = { protectZone = "sim", -- Precisa estar em PZ para usar o comando? skill = { item = 9971, -- Item removido quantidade = 10, -- Quantidade quantidadeskill = 10, -- Skill adicionada limiteskill = 350 -- Limite }, magicLevel = { item = 9971, -- Item removido quantidade = 15, -- Quantidade quantidademl = 5, -- Magic level adicionado limitedeml = 200 -- Limite }, skillID = { -- ID das skills ["club"] = SKILL_CLUB, ["sword"]= SKILL_SWORD, ["axe"] = SKILL_AXE, ["distance"] = SKILL_DISTANCE, ["shielding"] = SKILL_SHIELD }, vocationSkill = { -- Vocações que pode comprar x skill ["club"] = {4, 8}, ["sword"] = {4, 8}, ["axe"] = {4, 8}, ["distance"] = {3, 7}, ["shielding"] = {4, 8} }, vocationMagicLevel = {1, 2, 5, 6}, -- Vocações que pode comprar magic level delay = { skill = { storage = 45, duration = 5 -- Tempo para comprar skill novamente }, magicLevel = { storage = 97, duration = 5 -- Tempo para comprar magic level novamente } } } function onSay(cid, words, param, channel) local playerId = getPlayerGUID(cid) if config.protectZone == "sim" and not getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "Você precisa estar em protection zone para comprar.") end if param == "magiclevel" then if getPlayerMagLevel(cid) < config.magicLevel.limitedeml then if isInArray(config.vocationMagicLevel, getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, config.magicLevel.item, config.magicLevel.quantidade) then if (os.time() - getPlayerStorageValue(cid, config.delay.magicLevel.storage)) >= config.delay.magicLevel.duration then setPlayerStorageValue(cid, config.delay.magicLevel.storage, os.time()) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `maglevel` = `maglevel` + " .. config.magicLevel.quantidademl .. " WHERE `id` = " .. playerId) else doPlayerSendCancel(cid, "Espere " .. config.delay.magicLevel.duration .. " segundos para comprar novamente.") end else doPlayerSendCancel(cid, "Você não tem o item requerido.") end else doPlayerSendCancel(cid, "Voce não pode comprar magic level.") end else doPlayerSendCancel(cid, "Você chegou no limite de magic level.") end elseif config.skillID[string.lower(param)] then if getPlayerSkill(cid, config.skillID[string.lower(param)]) < config.skill.limiteskill then if isInArray(config.vocationSkill[string.lower(param)], getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, config.skill.item, config.skill.quantidade) then if (os.time() - getPlayerStorageValue(cid, config.delay.skill.storage)) >= config.delay.skill.duration then setPlayerStorageValue(cid, config.delay.skill.storage, os.time()) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `skill_sword` = `skill_sword` + " .. config.skill.quantidadeskill .. " WHERE `id` = " .. playerId) else doPlayerSendCancel(cid, "Espere " .. config.delay.skill.duration .. " segundos para comprar novamente.") end else doPlayerSendCancel(cid, "Você não tem o item requerido.") end else doPlayerSendCancel(cid, "Voce não pode comprar este skill.") end else doPlayerSendCancel(cid, "Você chegou no limite de skill.") end elseif config.skillID[string.lower(param)] then if getPlayerSkill(cid, config.skillID[string.lower(param)]) < config.skill.limiteskill then if isInArray(config.vocationSkill[string.lower(param)], getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, config.skill.item, config.skill.quantidade) then if (os.time() - getPlayerStorageValue(cid, config.delay.skill.storage)) >= config.delay.skill.duration then setPlayerStorageValue(cid, config.delay.skill.storage, os.time()) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `skill_axe` = `skill_axe` + " .. config.skill.quantidadeskill .. " WHERE `id` = " .. playerId) else doPlayerSendCancel(cid, "Espere " .. config.delay.skill.duration .. " segundos para comprar novamente.") end else doPlayerSendCancel(cid, "Você não tem o item requerido.") end else doPlayerSendCancel(cid, "Voce não pode comprar este skill.") end else doPlayerSendCancel(cid, "Você chegou no limite de skill.") end elseif config.skillID[string.lower(param)] then if getPlayerSkill(cid, config.skillID[string.lower(param)]) < config.skill.limiteskill then if isInArray(config.vocationSkill[string.lower(param)], getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, config.skill.item, config.skill.quantidade) then if (os.time() - getPlayerStorageValue(cid, config.delay.skill.storage)) >= config.delay.skill.duration then setPlayerStorageValue(cid, config.delay.skill.storage, os.time()) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `skill_club` = `skill_club` + " .. config.skill.quantidadeskill .. " WHERE `id` = " .. playerId) else doPlayerSendCancel(cid, "Espere " .. config.delay.skill.duration .. " segundos para comprar novamente.") end else doPlayerSendCancel(cid, "Você não tem o item requerido.") end else doPlayerSendCancel(cid, "Voce não pode comprar este skill.") end else doPlayerSendCancel(cid, "Você chegou no limite de skill.") end elseif config.skillID[string.lower(param)] then if getPlayerSkill(cid, config.skillID[string.lower(param)]) < config.skill.limiteskill then if isInArray(config.vocationSkill[string.lower(param)], getPlayerVocation(cid)) then if doPlayerRemoveItem(cid, config.skill.item, config.skill.quantidade) then if (os.time() - getPlayerStorageValue(cid, config.delay.skill.storage)) >= config.delay.skill.duration then setPlayerStorageValue(cid, config.delay.skill.storage, os.time()) doRemoveCreature(cid, true) db.query("UPDATE `players` SET `skill_dist` = `skill_dist` + " .. config.skill.quantidadeskill .. " WHERE `id` = " .. playerId) else doPlayerSendCancel(cid, "Espere " .. config.delay.skill.duration .. " segundos para comprar novamente.") end else doPlayerSendCancel(cid, "Você não tem o item requerido.") end else doPlayerSendCancel(cid, "Voce não pode comprar este skill.") end else doPlayerSendCancel(cid, "Você chegou no limite de skill.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Possíveis parâmetros: club, sword, axe, distance, shielding, magiclevel.") end return true end
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.