Olá, esse meu pc teleporta o player para uma hunt que você só sai dela se seu tempo acabar ou se você morrer (Só da para um player entrar nela, se outro tentar vai falar que ja tem gente la). Gostaria de colocar assim... O player só pode falar com esse npc se tiver a tal storage, ta ae o npc
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)
local pos = {x=1039, y=1072, z=7} -- Local da hunt
local posreturn = {x=1039, y=1072, z=7} -- Posiçao onde o player sera teleportado quando acabar o tempo
local money = 400000 --- Quanto de dinheiro sera removido
config = {
time = 1 ---Tempo que ele vai ficar na hunt sabendo que cada numeral equivale a um minuto-----
}
function doReturnPos()
doTeleportThing(cid, posreturn)
setGlobalStorageValue(24688, 0)
setGlobalStorageValue(24686, none)
setPlayerStorageValue(cid, 28680, 0)
end
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'chuunin') then
if getGlobalStorageValue(24688) == 1 then
doPlayerSendTextMessage(cid,22,"O player "..getGlobalStorageValue(24686).." esta fazendo o teste")
return true
end
if not doPlayerRemoveMoney(cid, money) then
doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." precisa de "..money.." para fazer o chuunin teste")
return true
end
doPlayerRemoveMoney(cid, money)
doPlayerSendTextMessage(cid,22,"Obrigado "..getPlayerName(cid).." foi teleportado.")
Pergunta
Allangod 2
Olá, esse meu pc teleporta o player para uma hunt que você só sai dela se seu tempo acabar ou se você morrer (Só da para um player entrar nela, se outro tentar vai falar que ja tem gente la). Gostaria de colocar assim... O player só pode falar com esse npc se tiver a tal storage, ta ae o npc
Vlws
Link para o comentário
https://xtibia.com/forum/topic/201553-colocar-npc-para-teleportar-se-tiver-storage/Compartilhar em outros sites
5 respostass a esta questão
Posts Recomendados