Postado Setembro 18, 2017 7 anos Solução Sim, a versão era diferente. Usa assim: Mostrar conteúdo oculto 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) end function onThink() npcHandler:onThink() end local storage = 56790 local item = {10581, 30} --id do item, quantidade function creatureSayCallback(cid, type, msg) local msg, player = string.lower(msg), Player(cid) if not npcHandler:isFocused(cid) then if isInArray({"hi", "hello"}, msg) then npcHandler:addFocus(cid) if player:getStorageValue(storage) == -1 then npcHandler:say("Hi, ".. player:getName().."! I can give you the permission to {enter} at Lost Souls' City.", cid) npcHandler.topic[cid] = 1 else npcHandler:say("You already have my permission to enter.", cid) npcHandler.topic[cid] = 0 npcHandler:releaseFocus(cid) end else return false end elseif msgcontains(msg, "enter") and npcHandler.topic[cid] == 1 then npcHandler:say("I need ".. item[2] .. " " .. getItemName(item[1])..". Do you have it?", cid) npcHandler.topic[cid] = 2 elseif msgcontains(msg, "yes") and npcHandler.topic[cid] == 2 then if player:removeItem(item[1], item[2]) then player:setStorageValue(storage, 1) npcHandler:say("Ok, now you can enter.", cid) npcHandler.topic[cid] = 0 else npcHandler:say("Sorry but you don't have the items I need.", cid) npcHandler.topic[cid] = 0 end elseif msgcontains(msg, "no") and npcHandler.topic[cid] == 2 then npcHandler:say("Ok, maybe on the next time.", cid) npcHandler.topic[cid] = 0 elseif msgcontains(msg, "bye") then npcHandler:say("Bye.", cid) npcHandler:releaseFocus(cid) else npcHandler:say("What?", cid) npcHandler.topic[cid] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) Mostrar conteúdo oculto local storage = 56790 function onStepIn(creature, item, position, fromPosition) if not creature:isPlayer() then return true end if creature:getStorageValue(storage) == -1 then creature:sendCancelMessage("You should pay to enter.") creature:teleportTo(fromPosition) end return true end <movevent event="StepIn" actionid="ACTION_ID_DO_PISO" script="tilepermission.lua" /> Contato: Email: dwarfer@sapo.pt Discord: Dwarfer#2715
Postado Abril 15, 2020 5 anos ALGUEM EDITA ESSE NPC PRA MIM. PRA ME DAR ESCOLHA DE 4 PISO. SÓ PODENDO ESCOLHER 1 DOS 4 LUGARES. ACHO Q 4 STORAGE NÉ?
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.