NOEM DO SEU NPC.xml
<?xml version="1.0"?>
<npc name="NOME DO SEU NPC" script="data/npc/scripts/nome do seu script.lua" walkinterval="5000" floorchange="0">
<health now="100" max="100"/>
<look type="134" head="78" body="88" legs="0" feet="88" addons="3"/>
<parameters>
<parameter key="message_greet" value="Ola |PLAYERNAME|.Eu sei sobre uma {passagem} muito misteriosa" />
</parameters>
</npc>
NPC/SCRIPT
nome do seu script.lua
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local storage,price = 78954,10000
if(msgcontains(msg, 'passagem') or msgcontains(msg, 'PASSAGEM')) then
selfSay('Você deseja comprar um acesso para a sala secreta por '..price..' gps? {yes} ', cid)
talkState[talkUser] = 1
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
if doPlayerRemoveMoney(cid, price) then
setPlayerStorageValue(cid,storage,1)
selfSay('Obrigado! Agora voce pode entrar na sala secreta!', cid)
talkState[talkUser] = 0
else
selfSay('Você não tem '..price..' gps para me pagar!', cid)
talkState[talkUser] = 0
end
elseif msg == "no" and talkState[talkUser] >= 1 then
selfSay("então ok,adeus.", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
actions/script
passagem_door.lua
local storage = 78954
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, storage) <= 0 then
return doPlayerSendTextMessage(cid,22,'Você não tem permissão para entrar nesta sala.compre com o Npc.')
end
pos = getPlayerPosition(cid)
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,"Stand in front of the door.")
return TRUE
end
doPlayerSendTextMessage(cid,22,"Você Entrou na Sala secreta.")
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
return TRUE
end
actions.xml
<action actionid="2085" script="passagem_door.lua"/>


info
Grupo: Campones
Registrado: 14/08/10
Posts: 53
Reputação: -1
Bom venho pedir um script assim..
a pessoa tem que ir no npc. falar com ele.
Player: hi
Npc: Ola Player Você deseja comprar a passagem para a sala Secreta? Isos irá lhe custar 10k
Player: Yes
Npc: Agora você pode entrar na Sala secreta...
Agora se a pessoa não tem o acesso. quando ele clika na porta aparece para ele:
Você não tem permissão para entrar nestasala. compre np Npc
e se ele tem a a permissão quando clika:
Você Entrou na Sala secreta..
NÃO PRECISA SER ASSIM. DAKELE GEITINHO. mais se puderem fazer o mais Parecido possivel.
Obrigado Gente. Espero resposta!