Postado Setembro 19, 2021 3 anos tfs 1.3 gostaria de fazer essa script: local config = { --[vocation id] = { level, nova voc, looktype, efeito} -- Goku [1] = { 25, 2, 3, 32}, [2] = { 50, 3, 4, 32}, [3] = { 75, 4, 5, 32}, [4] = { 100, 5, 7, 32}, [5] = { 125, 6, 6, 32}, [6] = { 150, 7, 8, 32}, [7] = { 200, 8, 9, 32}, [8] = { 250, 9, 17, 32}, [9] = { 300, 10, 630, 32} } function onSay(cid, words, param, channel) local voc = config[getPlayerVocation(cid)] if voc then if getPlayerLevel(cid) >= voc[1] then doPlayerSetVocation(cid, voc[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce se transformou!") doCreatureSay(cid, "Transformar", 19) local outfit = {lookType = voc[3]} doCreatureChangeOutfit(cid, outfit) doSendMagicEffect(getCreaturePosition(cid), voc[4]) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce precisa estar no level " .. voc[1] .. " para transformar.") end else doPlayerSendCancel(cid, "Nao é possível se transformar.") end return true end Virar em TFS 1.3, pois funciona, mais a outfit não muda só se eu relogar! e o efeito tbm não esta indo!
Postado Setembro 19, 2021 3 anos Solução local config = { --[vocation id] = { level, nova voc, looktype, efeito} -- Goku [1] = { 25, 2, 3, 32}, [2] = { 50, 3, 4, 32}, [3] = { 75, 4, 5, 32}, [4] = { 100, 5, 7, 32}, [5] = { 125, 6, 6, 32}, [6] = { 150, 7, 8, 32}, [7] = { 200, 8, 9, 32}, [8] = { 250, 9, 17, 32}, [9] = { 300, 10, 630, 32} } function onSay(player, words, param) local vocation = player:getVocation():getId() local voc = config[vocation] if(not(voc))then return(player:sendTextMessage(MESSAGE_STATUS_SMALL, player:getName() .. " Nao é possível se transformar.") and false) end if(player:getLevel() >= voc[1])then player:setVocation(voc[2]) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, player:getName() .. " Voce se transformou!") player:say("Transformar") player:setOutfitLookType(voc[3]) player:getPosition():sendMagicEffect(voc[4]) return(false) else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, player:getName() .. " Nao é possível se transformar.") return(false) end end Coloque em lib/core/creature.lua : function Creature:setOutfitLookType(value) local outfit = self:getOutfit() outfit.lookType = value self:setOutfit(outfit) return(true) end Editado Setembro 19, 2021 3 anos por najatheus (veja o histórico de edições)
Postado Setembro 19, 2021 3 anos Autor Em 19/09/2021 em 05:03, najatheus disse: local config = { --[vocation id] = { level, nova voc, looktype, efeito} -- Goku [1] = { 25, 2, 3, 32}, [2] = { 50, 3, 4, 32}, [3] = { 75, 4, 5, 32}, [4] = { 100, 5, 7, 32}, [5] = { 125, 6, 6, 32}, [6] = { 150, 7, 8, 32}, [7] = { 200, 8, 9, 32}, [8] = { 250, 9, 17, 32}, [9] = { 300, 10, 630, 32} } local function transformOutfit(player, value) local outfit = player:getOutfit() outfit.lookType = value player:setOutfit(outfit) return(true) end function onSay(player, words, param) local vocation = player:getVocation() local voc = config[vocation] if(not(voc))then return(false) end if(player:getLevel() >= voc[1])then player:setVocation(voc[2]) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, player:getName() .. " Voce se transformou!") player:say("Transformar") transformOutfit(voc[3]) player:getPosition():sendMagicEffect(voc[4]) return(false) else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, player:getName() .. " Nao é possível se transformar.") return(false) end end Não acontece nada, e não dar erro na source, como nada tivesse escrito.
Postado Setembro 19, 2021 3 anos Troque a linha : local vocation = player:getVocation() Para : local vocation = player:getVocation():getId()
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.