Postado Julho 14, 2019 5 anos Eu estou precisando de um código que o npc troque a newtype do personagem, atualmente eu estou usando como o código: doPlayerAddOutfit(cid, 4) Mas dá um erro, eu quero que o npc mude o newtype automaticamente, se tiver outro código sem ser o "doPlayerAddOutfit(cid, 4)", pode me mandar? Desde já agradeço! Script: Citar local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg:lower()) end function onThink() npcHandler:onThink() end local talkState = {} function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "travel") then selfSay("Eu posso transformar em um {Jiren}", cid) end if msgcontains(msg, "Jiren") then selfSay("Voce realmente quer virar um {Jiren}?", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getPlayerStorageValue(cid,100000025) == 1 then if not isPlayerPzLocked(cid) then doPlayerSetVocation(cid, 2) doPlayerAddOutfit(cid, 4) npcHandler:releaseFocus(cid) else selfSay("Voce deve estar sem pz locked!", cid) end elseif getPlayerStorageValue(cid,100000025) ~= 1 then selfSay("Desculpe, voce nao possui esse personagem desbloqueado!", cid) end talkState[talkUser] = 0 en return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Erro que aparece:
Postado Julho 14, 2019 5 anos @Stareqj Para trocar a outfit do player: doCreatureChangeOutfit(cid, {lookType = outfit}) Para adicionar uma outfit a um player, nesse tópico tem a respota. ttps://tibiaking.com/forums/topic/95814-itemoutfit/page/2/
Postado Julho 17, 2019 5 anos Autor Em 14/07/2019 em 14:03, JoviM disse: @Stareqj Para trocar a outfit do player: doCreatureChangeOutfit(cid, {lookType = outfit}) Para adicionar uma outfit a um player, nesse tópico tem a respota. ttps://tibiaking.com/forums/topic/95814-itemoutfit/page/2/ Obrigado, era isso mesmo o que eu queria, eu não achava uma função para isso, tentei várias, mas não tentei usar essa com o looktype e local outfit REP+
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.