Ir para conteúdo

Featured Replies

  • Respostas 22
  • Visualizações 2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Tem um ( sobrando aí, tira ele, deixa: if getPlayerStorageValue(cid, 10274, 10275, 10276, 10277, 10278, 10279, 10280) == 1 then Se não der, use o and: if getPlayerStorageValue(cid, 10274) =

  • 1 - local tab = { price = 50, -- Preco BLESS, 50 = 50k price2 = 20 -- Preco AOL, 20 = 20k } local bless = {1, 2, 3, 4, 5} local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandl

  • local tab = { level = 100, pos = {x = 1071, y = 1135, z = 10}, storage = 6666 -- Storage } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) Npc

Postado
  • Autor

@Kemmlly Camarada não querendo abusar da sua boa vontade, mas já o fazendo.

 

Tenho esse npc no server que teleporta o player para o local se tiver level 100+ , mas queria saber se é possível adicionar um storageid nele para que o player possa ser teleportado apenas uma vez. Mas caso ele não mate o boss ai pode tentar novamente.

 

local tab = {
    level = 100,
    pos = {x = 1071, y = 1135, z = 10}
}
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
    if (msgcontains(msg, 'challenge')) then
        talkState[talkUser] = 1
        selfSay('You are sure you want to go? You can not return.', cid)
    elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
        if (getPlayerLevel(cid) >= tab.level) then
            talkState[talkUser] = 0
            doTeleportThing(cid, tab.pos)
            doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
        else
            talkState[talkUser] = 0
            selfSay('I can only challenge players with level '..tab.level..' or more.', cid)
        end
    elseif (msgcontains(msg, 'no') and talkState[talkUser] == 1) then
        talkState[talkUser] = 0
        selfSay('Come back when you are ready learner.', cid)
    end
    
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Postado
12 minutos atrás, Felipe Lotz disse:

@Kemmlly Camarada não querendo abusar da sua boa vontade, mas já o fazendo.

 

Tenho esse npc no server que teleporta o player para o local se tiver level 100+ , mas queria saber se é possível adicionar um storageid nele para que o player possa ser teleportado apenas uma vez. Mas caso ele não mate o boss ai pode tentar novamente.

 


local tab = {
    level = 100,
    pos = {x = 1071, y = 1135, z = 10}
}
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
    if (msgcontains(msg, 'challenge')) then
        talkState[talkUser] = 1
        selfSay('You are sure you want to go? You can not return.', cid)
    elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
        if (getPlayerLevel(cid) >= tab.level) then
            talkState[talkUser] = 0
            doTeleportThing(cid, tab.pos)
            doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
        else
            talkState[talkUser] = 0
            selfSay('I can only challenge players with level '..tab.level..' or more.', cid)
        end
    elseif (msgcontains(msg, 'no') and talkState[talkUser] == 1) then
        talkState[talkUser] = 0
        selfSay('Come back when you are ready learner.', cid)
    end
    
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

 

local tab = {
    level = 100,
    pos = {x = 1071, y = 1135, z = 10},
    storage = 6666 -- Storage
}
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
    if (msgcontains(msg, 'challenge')) then
        talkState[talkUser] = 1
        selfSay('You are sure you want to go? You can not return.', cid)
    elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
        if (getPlayerLevel(cid) >= tab.level) and getPlayerStorageValue(cid, tab.storage) < 1 then
            talkState[talkUser] = 0
            doTeleportThing(cid, tab.pos)
            setPlayerStorageValue(cid, tab.storage, 1)
            doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
        elseif getPlayerStorageValue(cid, tab.storage) == 1 then
        selfSay('Voce ja matou o BOSS!', cid)
        elseif (getPlayerLevel(cid) < tab.level) then
            talkState[talkUser] = 0
            selfSay('I can only challenge players with level '..tab.level..' or more.', cid)
        end
    elseif (msgcontains(msg, 'no') and talkState[talkUser] == 1) then
        talkState[talkUser] = 0
        selfSay('Come back when you are ready learner.', cid)
    end
    
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

16 minutos atrás, kauan13 disse:

alguém pode me ajudar preciso de 1 script que fique saindo [VIP] no player quando ele tiver premium account

Subir efeito no player ou [VIP] atrás do nome do jogador?

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.6k

Informação Importante

Confirmação de Termo