Postado Maio 22, 2015 10 anos @andreoam, não testei. local level = 20 function onAdvance(player, skill, oldLevel, newLevel) local storage = 15001 if (skill == 8) and player:getLevel() >= level and player:getStorageValue(storage) < 1 then local vocation = player:getVocation() local promotion = vocation:getPromotion() player:setVocation(promotion) player:setStorageValue(storage, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations! You are now promoted.") end return true end Testado e aprovado. Segue o script Modificado. local tabela = { -- [level] = type = "item", id = ITEM_ID, id2 = QUANTIDADE, msg = "MENSAGEM"}, -- [level] = type = "addon", id = ID_ADDON_FEMALE, id2 = ID_ADDON_MALE, msg = "MENSAGEM"}, -- [level] = type = "mount", id = ID_MOUNT, id2 = 0, msg = "MENSAGEM"}, [20] = {type = "item", id = 2160, id2 = 2, msg = "Voce ganhou 2 crystal coins por alcancar o level 20!"}, [20] = {type = "promote", id = 2160, id2 = 2, msg = "Voce foi promovido e ganhou 2 crystal coins por alcancar o level 20!"}, [40] = {type = "addon", id = 136, id2 = 128, msg = "Voce ganhou o addon citizen full por alcancar o level 40!"}, [50] = {type = "item", id = 2160, id2 = 5, msg = "Voce ganhou 5 crystal coins por alcancar o level 50!"}, [60] = {type = "mount", id = 2, id2 = 0, msg = "Voce ganhou uma montaria!"}, [100] = {type = "item", id = 2160, id2 = 10, msg = "Voce ganhou 10 crystal coins por alcancar o level 100!"}, [150] = {type = "item", id = 2160, id2 = 15, msg = "Voce ganhou 15 crystal coins por alcancar o level 150!"}, [200] = {type = "item", id = 2160, id2 = 20, msg = "Voce ganhou 20 crystal coins por alcancar o level 200!"}, [250] = {type = "item", id = 2160, id2 = 25, msg = "Voce ganhou 25 crystal coins por alcancar o level 250!"}, [300] = {type = "item", id = 2160, id2 = 30, msg = "Voce ganhou 30 crystal coins por alcancar o level 300!"}, } local storage = 15000 function onAdvance(player, skill, oldLevel, newLevel) if (skill == 8) then for level, _ in pairs(tabela) do if player:getLevel() >= level and player:getStorageValue(storage) < level then if tabela[level].type == "item" then player:addItem(tabela[level].id, tabela[level].id2) elseif tabela[level].type == "addon" then player:addOutfitAddon(tabela[level].id, 3) player:addOutfitAddon(tabela[level].id2, 3) elseif tabela[level].type == "mount" then player:addMount(tabela[level].id) elseif tabela[level].type == "promote" then local vocation = player:getVocation() local promotion = vocation:getPromotion() player:setVocation(promotion) player:addItem(tabela[level].id, tabela[level].id2) else return false end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, tabela[level].msg) player:setStorageValue(storage, level) end end end player:save() -- salvando player return true end
Postado Abril 19, 2016 9 anos On 5/19/2015 at 2:32 PM, luanluciano93 said: @andreoam, não testei. local level = 20 function onAdvance(player, skill, oldLevel, newLevel) local storage = 15001 if (skill == 8) and player:getLevel() >= level and player:getStorageValue(storage) < 1 then local vocation = player:getVocation() local promotion = vocation:getPromotion() player:setVocation(promotion) player:setStorageValue(storage, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations! You are now promoted.") end return true end funciona para tfs 1.2 ? abraços.
Postado Abril 20, 2016 9 anos 9 horas atrás, Thunder Black disse: funciona para tfs 1.2 ? abraços. eu uso este no meu tfs 1.2 local tabela = { -- [level] = type = "item", id = ITEM_ID, id2 = QUANTIDADE, msg = "MENSAGEM"}, -- [level] = type = "addon", id = ID_ADDON_FEMALE, id2 = ID_ADDON_MALE, msg = "MENSAGEM"}, -- [level] = type = "mount", id = ID_MOUNT, id2 = 0, msg = "MENSAGEM"}, [20] = {type = "promote", id = 2160, id2 = 2, msg = "Parabens! Voce foi promovido e ganhou 2 Crystal Coins"}, [40] = {type = "addon", id = 136, id2 = 128, msg = "Voce ganhou o addon citizen full por alcancar o level 40!"}, [50] = {type = "item", id = 2160, id2 = 5, msg = "Voce ganhou 5 crystal coins por alcancar o level 50!"}, [60] = {type = "mount", id = 2, id2 = 0, msg = "Voce ganhou uma montaria!"}, [100] = {type = "item", id = 2160, id2 = 10, msg = "Voce ganhou 10 crystal coins por alcancar o level 100!"}, [150] = {type = "item", id = 2160, id2 = 15, msg = "Voce ganhou 15 crystal coins por alcancar o level 150!"}, [200] = {type = "item", id = 2160, id2 = 20, msg = "Voce ganhou 20 crystal coins por alcancar o level 200!"}, [250] = {type = "item", id = 2160, id2 = 25, msg = "Voce ganhou 25 crystal coins por alcancar o level 250!"}, [300] = {type = "item", id = 2160, id2 = 30, msg = "Voce ganhou 30 crystal coins por alcancar o level 300!"}, } local storage = 15000 function onAdvance(player, skill, oldLevel, newLevel) if (skill == 8) then for level, _ in pairs(tabela) do if player:getLevel() >= level and player:getStorageValue(storage) < level then if tabela[level].type == "item" then player:addItem(tabela[level].id, tabela[level].id2) elseif tabela[level].type == "addon" then player:addOutfitAddon(tabela[level].id, 3) player:addOutfitAddon(tabela[level].id2, 3) elseif tabela[level].type == "mount" then player:addMount(tabela[level].id) elseif tabela[level].type == "promote" then local vocation = player:getVocation() local promotion = vocation:getPromotion() player:setVocation(promotion) player:addItem(tabela[level].id, tabela[level].id2) else return false end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, tabela[level].msg) player:setStorageValue(storage, level) end end end player:save() -- salvando player return true end
Postado Maio 4, 2016 9 anos @luanluciano93 não posso deixar de vir aqui pra dar +REP pra esse grande homem que tem me ajudado imensamente, com esses belos tutoriais! vi recentemente um tutorial seu tambem falando sobre Usbwebserver, esse programa é espetacular meu grande, bota o xampp no bolso. essa comunidade precisa saber mexer nesse programa, mexi bastante até entendi como ele funciona, um pouco parecido com o xampp. você está de parabéns Luan. Obrigado, forte abraço.
Postado Junho 29, 2016 8 anos muito bom script funcional! (tfs 1.2) Porém, a montaria o player não ta ganhando, ele ganha todos os outros itens mas a montaria não... O meu ta assim: [220] = {type = "mount", id = 390, id2 = 0, msg = "Voce ganhou a montaria do crystal wolf por alcancar o level 220!"}, no caso 390 é o looktype id do crystal wolf mount e 391 é do crystal wolf criatura... Alguém sabe me dizer pq não ganha?
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.