Postado Setembro 9, 2020 4 anos Guys, no meu server tem um npc que teletransporta o Player para um outro lugar porém, ele não cobra nada. Queria que fosse cobrado uma certa quantidade de um item que eu tenho aqui no server. Esse npc também pede para você conversar com outro npc primeiro antes dele te levar para o outro lugar e eu queria tirar essa frescura de falar com outro npc. Enfim, espero que entendam! Sou péssimo para explicar as coisas kkkk PS: Não sei se o tópico está no local certo. xd Spoiler local STORAGE = 30023 -- Storage necessária para viajar local DESTINO = {x = 424, y = 400, z = 13} -- POSIÇÃO DE DESTINO 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, "reborn") then selfSay("Já falou com a Bulma?, Tem Certesa Que Deseja Proceseguir ?.", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if (getPlayerStorageValue(cid,30023) ~= 4) and (getPlayerStorageValue(cid,43234) == 1) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, DESTINO) doSendMagicEffect(DESTINO, 10) elseif getPlayerStorageValue(cid,30023) == 4 then selfSay("Voce ja rebornou, vaza daqui fdp antes que eu retire seu Reborn!", cid) elseif getPlayerStorageValue(cid,43234) ~= 1 then selfSay("Primeiro encontre a Bulma que esta a procura de danos para reparar em Small City.", cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Setembro 10, 2020 4 anos Testa ai! local STORAGE = 30023 -- Storage necessária para viajar local DESTINO = {x = 424, y = 400, z = 13} -- POSIÇÃO DE DESTINO -- Configurar Aqui local von = 2160 -- Id Do item que você deseja remover local dale = 100 -- Quantidade do item que voce deseja remover local txt = "Você não tem TAL ITEM" -- Colocar a resposta caso o jogador não tenha os itens -- 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, "reborn") then selfSay("Já falou com a Bulma?, Tem Certesa Que Deseja Proceseguir ?.", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if (getPlayerStorageValue(cid,30023) ~= 4) and (getPlayerStorageValue(cid,43234) == 1) then local player = Player(cid) if player:removeItem(von, dale) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, DESTINO) doSendMagicEffect(DESTINO, 10) else selfSay(txt, cid) end elseif getPlayerStorageValue(cid,30023) == 4 then selfSay("Voce ja rebornou, vaza daqui fdp antes que eu retire seu Reborn!", cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Setembro 10, 2020 4 anos Autor @Von Dale não funcionou, ele ainda pede para eu falar com outro npc antes de falar com ele. eu queria que ele simplesmente cobrasse o item sem precisar conversar com nenhum outro npc. Spoiler
Postado Setembro 11, 2020 4 anos local STORAGE = 30023 -- Storage necessária para viajar local DESTINO = {x = 424, y = 400, z = 13} -- POSIÇÃO DE DESTINO -- Configurar Aqui local von = 2160 -- Id Do item que você deseja remover local dale = 100 -- Quantidade do item que voce deseja remover local txt = "Você não tem TAL ITEM" -- Colocar a resposta caso o jogador não tenha os itens -- 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, "reborn") then if (getPlayerStorageValue(cid,30023) ~= 4) and (getPlayerStorageValue(cid,43234) == 1) then if doPlayerRemoveItem(cid, von, dale) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, DESTINO) doSendMagicEffect(DESTINO, 10) else selfSay(txt, cid) end elseif getPlayerStorageValue(cid,30023) == 4 then selfSay("Voce ja rebornou, vaza daqui fdp antes que eu retire seu Reborn!", cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
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.