Postado Abril 8, 2022 3 anos .Olá pessoal boa noite, Alguém poderia me ajudar a fazer uma alteração no meu script de trainers offline. Gostaria que acrescentasse neste script somente x vocação pode clicar em determinada estatua para treinar offline. Sendo assim o jogador precisa encontrar sua estatua da sua vocação. Mostrar conteúdo oculto function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.itemid == 1444) then -- sword doCreatureSetStorage(cid, 62669, SKILL_SWORD) elseif(item.itemid == 8836) then -- axe doCreatureSetStorage(cid, 62669, SKILL_AXE) elseif(item.itemid == 8834) then -- mlvl doCreatureSetStorage(cid, 62669, SKILL__MAGLEVEL) elseif(item.itemid == 8626) then -- club doCreatureSetStorage(cid, 62669, SKILL_CLUB) elseif(item.itemid == 10353) then -- distannce doCreatureSetStorage(cid, 62669, SKILL_DISTANCE) end if item.actionid == 6341 then doRemoveCreature(cid) end return true end Agradeço deste já muito obrigado! Utilizo TFS 0.4 - 8.6 VENHAM JOGAR O MELHOR BAIAK JÁ CRIADO DE 2022!! CRIE SUA CONTA AGORA MESMO! www.baiakudo.com
Postado Abril 9, 2022 3 anos @DeathRocks Boa noite, tenta assim: local storage = 62669 local message = "Voce nao pode treinar essa skill, escolha a estatua de sua vocacao." local config = { [1444] = { -- ID statue vocations = {4, 8}, -- Knight and Elite Knight skill = SKILL_SWORD }, [8836] = { vocations = {4, 8}, -- Knight, Elite Knight skill = SKILL_AXE }, [8834] = { vocations = {1, 2, 5, 6}, -- Sorcerer, Druid, Master Sorcerer, Elder Druid skill = SKILL__MAGLEVEL }, [8626] = { vocations = {4, 8}, -- Knight, Elite Knight skill = SKILL_CLUB }, [10353] = { vocations = {3, 7}, -- Paladin, Royal Paladin skill = SKILL_DISTANCE }, } function onUse(cid, item, fromPosition, itemEx, toPosition) for i = 1, #config[item.itemid].vocations, 1 do local vocation = config[item.itemid].vocations[i] local skill = config[item.itemid].skill if (getPlayerVocation(cid) == vocation) then doCreatureSetStorage(cid, storage, skill) break else doPlayerSendCancel(cid, message) end end if item.actionid == 6341 then doRemoveCreature(cid) end return true end
Postado Abril 9, 2022 3 anos Autor Em 09/04/2022 em 02:37, MatteusDeli disse: @DeathRocks Boa noite, tenta assim: local storage = 62669 local message = "Voce nao pode treinar essa skill, escolha a estatua de sua vocacao." local config = { [1444] = { -- ID statue vocations = {4, 8}, -- Knight and Elite Knight skill = SKILL_SWORD }, [8836] = { vocations = {4, 8}, -- Knight, Elite Knight skill = SKILL_AXE }, [8834] = { vocations = {1, 2, 5, 6}, -- Sorcerer, Druid, Master Sorcerer, Elder Druid skill = SKILL__MAGLEVEL }, [8626] = { vocations = {4, 8}, -- Knight, Elite Knight skill = SKILL_CLUB }, [10353] = { vocations = {3, 7}, -- Paladin, Royal Paladin skill = SKILL_DISTANCE }, } function onUse(cid, item, fromPosition, itemEx, toPosition) for i = 1, #config[item.itemid].vocations, 1 do local vocation = config[item.itemid].vocations[i] local skill = config[item.itemid].skill if (getPlayerVocation(cid) == vocation) then doCreatureSetStorage(cid, storage, skill) break else doPlayerSendCancel(cid, message) end end if item.actionid == 6341 then doRemoveCreature(cid) end return true end Olá bom dia, não deu certo. Continua deslogando em qualquer estátua... VENHAM JOGAR O MELHOR BAIAK JÁ CRIADO DE 2022!! CRIE SUA CONTA AGORA MESMO! www.baiakudo.com
Postado Abril 9, 2022 3 anos @DeathRocks Tenta agora local storage = 62669 local message = "Voce nao pode treinar essa skill, escolha a estatua de sua vocacao." local config = { [1444] = { -- ID statue vocations = {4, 8}, -- Knight and Elite Knight skill = SKILL_SWORD }, [8836] = { vocations = {4, 8}, -- Knight, Elite Knight skill = SKILL_AXE }, [8834] = { vocations = {1, 2, 5, 6}, -- Sorcerer, Druid, Master Sorcerer, Elder Druid skill = SKILL__MAGLEVEL }, [8626] = { vocations = {4, 8}, -- Knight, Elite Knight skill = SKILL_CLUB }, [10353] = { vocations = {3, 7}, -- Paladin, Royal Paladin skill = SKILL_DISTANCE }, } function onUse(cid, item, fromPosition, itemEx, toPosition) for i = 1, #config[item.itemid].vocations, 1 do local vocation = config[item.itemid].vocations[i] local skill = config[item.itemid].skill if (getPlayerVocation(cid) == vocation and item.actionid == 6341) then doCreatureSetStorage(cid, storage, skill) doRemoveCreature(cid) break else doPlayerSendCancel(cid, message) end end return true end
Postado Abril 9, 2022 3 anos Autor Em 09/04/2022 em 14:35, MatteusDeli disse: @DeathRocks Tenta agora local storage = 62669 local message = "Voce nao pode treinar essa skill, escolha a estatua de sua vocacao." local config = { [1444] = { -- ID statue vocations = {4, 8}, -- Knight and Elite Knight skill = SKILL_SWORD }, [8836] = { vocations = {4, 8}, -- Knight, Elite Knight skill = SKILL_AXE }, [8834] = { vocations = {1, 2, 5, 6}, -- Sorcerer, Druid, Master Sorcerer, Elder Druid skill = SKILL__MAGLEVEL }, [8626] = { vocations = {4, 8}, -- Knight, Elite Knight skill = SKILL_CLUB }, [10353] = { vocations = {3, 7}, -- Paladin, Royal Paladin skill = SKILL_DISTANCE }, } function onUse(cid, item, fromPosition, itemEx, toPosition) for i = 1, #config[item.itemid].vocations, 1 do local vocation = config[item.itemid].vocations[i] local skill = config[item.itemid].skill if (getPlayerVocation(cid) == vocation and item.actionid == 6341) then doCreatureSetStorage(cid, storage, skill) doRemoveCreature(cid) break else doPlayerSendCancel(cid, message) end end return true end Agora de certo, porem ele tá repetindo 3x a função doPlayerSendCancel(cid, message) Ao clicar na estatua. Em vez de avisar apenas uma vez ao clicar... VENHAM JOGAR O MELHOR BAIAK JÁ CRIADO DE 2022!! CRIE SUA CONTA AGORA MESMO! www.baiakudo.com
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.