Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Base: 0.4

 

Bom dia meu povo, como o titulo já diz, eu queria uma script que fizesse isso; clica na porta, é checado se o player tem a storage, é teleportado para um lugar x se tiver, uma msg aparece pra ele se não tiver a storage.

 

Citar

local config = {
tepos = {x=0000, y=0000, z=0} 
}
function onUse(cid, item, frompos, item2, topos)
if doTeleportThing(cid, config.tepos) then
doPlayerSendTextMessage(cid, 22, "")
end
return true
end 

 

 

Resolvido por Agaka

Ir para solução
  • Respostas 9
  • Visualizações 967
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @Zazeros   

  • -- Config # KOLISAO # -- local pos_sucess = {x = 100, y = 100, z = 7} -- POS CASO TENHA STORAGE local stor = 15457 -- STORAGE -- END -- function onUse(cid, item, frompos, item2, topos) if getPlaye

  • @Zazeros Já coloquei a storage que o player ganha o falar com o npc no script, falta configurar a posição. Edit: Estava dando problema pq a storage que o player ganhava no npc estava diferente

Postado

@Zazeros 

Citar

local storage = 2501
local newpos = {x = 1000, y = 1000,  z = 7}

function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerStorageValue(cid, storage) == 1 then

    doTeleportThing(cid, newpos)

else

doPlayerSendTextMessage(cid, 27, "mensagem que o player vai receber")

    doSendMagicEffect(getCreaturePosition(cid), 2)

        end

    return true

end

 

Postado
  • Autor

@Jovim Alterei sim. Os players estão ganhando através dessa quest, quando acabam de falar com o npc:

Citar

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local talkState = {}
local quest = 11269
local reward = 70000

 


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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(not npcHandler:isFocused(cid)) then
    return false
elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
    npcHandler:say("", cid)
    talkState[talkUser] = 2
elseif msgcontains(msg, "yes") and talkState[talkUser] == 2 then
    npcHandler:say("", cid)
    setPlayerStorageValue(cid, quest, 2)
    talkState[talkUser] = 0
elseif msgcontains(msg, "aceitar") then
    local str = getPlayerStorageValue(cid, quest)
    if(str < 2) then
        npcHandler:say("", cid) 
        talkState[talkUser] = 1
        return true
    elseif(str == 2) then
        npcHandler:say(".", cid)
    elseif(str == 3) then
        npcHandler:say(" ", cid)
        doPlayerAddExp(cid, 2000000)
        doPlayerAddItem(cid,2152,30)
        setPlayerStorageValue(cid, quest, 4)
    elseif(str == 4) then
        npcHandler:say("Voce ja matou nosso alvo.", 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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo