Ir para conteúdo

NPC Que puxa 4 Player


DrewMarques

Posts Recomendados

Agora, Caronte disse:
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endlocal cfg = {    toPos = {x=1039, y=563, z=7}, -- Posição que o jogador sera teleportado    level = 1, -- Level necessário para ser teleportado    price = 0, -- Dinheiro a ser cobrado para ser teleportado    {x=1063, y=880, z=7},    {x=1063, y=881, z=7},     {x=1063, y=882, z=7},     {x=1063, y=883, z=7}, }local naopode = 0function 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, 'sim') then        selfSay('You are sure you want to go? You can not return.', cid)        talkState[talkUser] = 1    elseif talkState[talkUser] == 1 then        if msgcontains(msg, 'yes') then            naopode = 0            if getPlayerLevel(cid) >= cfg.level then                for i = 1, 4 do                    if not isPlayer(getThingFromPos(cfg[p])) then                         naopode = 1                    else 						naopode = 0					end                end                 if naopode == 0 then                    if doPlayerRemoveMoney(cid, cfg.price) then                        for p = 1, 4 do                             doTeleportThing(getThingFromPos(cfg[p]), cfg.toPos)                        end                        talkState[talkUser] = 0                    else                        selfSay('You don\'t have enough money.', cid)                    end                                    else                     selfSay('Desculpe Mais Precisa de um grupo de 4 Players', cid)                    talkState[talkUser] = 0                end            else                selfSay('You need level having above '.. cfg.level ..'.', cid)            end        elseif msgcontains(msg, 'no') then            selfSay('Skirt here!', cid)        end    endendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())

 

11/06/2017 21:44:05] datapack/npc/scripts/jenny.lua:onCreatureSay [11/06/2017 21:44:05] Description: [11/06/2017 21:44:05] attempt to index a nil value [11/06/2017 21:44:05] stack traceback: [11/06/2017 21:44:05] [C]: in function 'getThingFromPos' [11/06/2017 21:44:05] datapack/npc/scripts/jenny.lua:37: in function 'callback' [11/06/2017 21:44:05] datapack/npc/lib/npcsystem/npchandler.lua:391: in function 'onCreatureSay' [11/06/2017 21:44:05] datapack/npc/scripts/jenny.lua:8: in function <datapack/npc/scripts/jenny.lua:8>

Link para o comentário
Compartilhar em outros sites

 

 

local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endlocal cfg = {    toPos = {x=1039, y=563, z=7}, -- Posição que o jogador sera teleportado    level = 1, -- Level necessário para ser teleportado    price = 0, -- Dinheiro a ser cobrado para ser teleportado    {x=1063, y=880, z=7},    {x=1063, y=881, z=7},     {x=1063, y=882, z=7},     {x=1063, y=883, z=7}, }local naopode = 0function 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, 'sim') then        selfSay('You are sure you want to go? You can not return.', cid)        talkState[talkUser] = 1    elseif talkState[talkUser] == 1 then        if msgcontains(msg, 'yes') then            naopode = 0            if getPlayerLevel(cid) >= cfg.level then                for i = 1, 4 do                    if not isPlayer(getThingFromPos(cfg[i])) then                         naopode = 1                    else 						naopode = 0					end                end                 if naopode == 0 then                    if doPlayerRemoveMoney(cid, cfg.price) then                        for p = 1, 4 do                             doTeleportThing(getThingFromPos(cfg[p]), cfg.toPos)                        end                        talkState[talkUser] = 0                    else                        selfSay('You don\'t have enough money.', cid)                    end                                    else                     selfSay('Desculpe Mais Precisa de um grupo de 4 Players', cid)                    talkState[talkUser] = 0                end            else                selfSay('You need level having above '.. cfg.level ..'.', cid)            end        elseif msgcontains(msg, 'no') then            selfSay('Skirt here!', cid)        end    endendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())

 

Mano kkkkkkkkkkkk

Tô errando assim pq to enferrujado.

Link para o comentário
Compartilhar em outros sites

46 minutos atrás, Caronte disse:

 

 

local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endlocal cfg = {    toPos = {x=1039, y=563, z=7}, -- Posição que o jogador sera teleportado    level = 1, -- Level necessário para ser teleportado    price = 0, -- Dinheiro a ser cobrado para ser teleportado    {x=1063, y=880, z=7},    {x=1063, y=881, z=7},     {x=1063, y=882, z=7},     {x=1063, y=883, z=7}, }local naopode = 0function 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, 'sim') then        selfSay('You are sure you want to go? You can not return.', cid)        talkState[talkUser] = 1    elseif talkState[talkUser] == 1 then        if msgcontains(msg, 'yes') then            naopode = 0            if getPlayerLevel(cid) >= cfg.level then                for i = 1, 4 do                    if not isPlayer(getThingFromPos(cfg[i])) then                         naopode = 1                    else 						naopode = 0					end                end                 if naopode == 0 then                    if doPlayerRemoveMoney(cid, cfg.price) then                        for p = 1, 4 do                             doTeleportThing(getThingFromPos(cfg[p]), cfg.toPos)                        end                        talkState[talkUser] = 0                    else                        selfSay('You don\'t have enough money.', cid)                    end                                    else                     selfSay('Desculpe Mais Precisa de um grupo de 4 Players', cid)                    talkState[talkUser] = 0                end            else                selfSay('You need level having above '.. cfg.level ..'.', cid)            end        elseif msgcontains(msg, 'no') then            selfSay('Skirt here!', cid)        end    endendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())

 

Mano kkkkkkkkkkkk

Tô errando assim pq to enferrujado.

Continua pedindo os 4 player tendo os 4 players

Link para o comentário
Compartilhar em outros sites

Spoiler
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endlocal cfg = {    toPos = {x=1039, y=563, z=7}, -- Posição que o jogador sera teleportado    level = 1, -- Level necessário para ser teleportado    price = 0, -- Dinheiro a ser cobrado para ser teleportado    {x=1063, y=880, z=7},    {x=1063, y=881, z=7},     {x=1063, y=882, z=7},     {x=1063, y=883, z=7}, }local naopode = 0function 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, 'sim') then        selfSay('You are sure you want to go? You can not return.', cid)        talkState[talkUser] = 1    elseif talkState[talkUser] == 1 then        if msgcontains(msg, 'yes') then            naopode = 0            if getPlayerLevel(cid) >= cfg.level then                for i = 1, 4 do                    if isPlayer(getThingFromPos(cfg[i]).uid) then                         naopode = 0                    else 						naopode = 1						break					end                end                 if naopode == 0 then                    if doPlayerRemoveMoney(cid, cfg.price) then                        for p = 1, 4 do                             doTeleportThing(getThingFromPos(cfg[p]), cfg.toPos)                        end                        talkState[talkUser] = 0                    else                        selfSay('You don\'t have enough money.', cid)                    end                                    else                     selfSay('Desculpe Mais Precisa de um grupo de 4 Players', cid)                    talkState[talkUser] = 0                end            else                selfSay('You need level having above '.. cfg.level ..'.', cid)            end        elseif msgcontains(msg, 'no') then            selfSay('Skirt here!', cid)        end    endendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())

 

 

Link para o comentário
Compartilhar em outros sites

Agora, Caronte disse:
  Mostrar conteúdo oculto
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endlocal cfg = {    toPos = {x=1039, y=563, z=7}, -- Posição que o jogador sera teleportado    level = 1, -- Level necessário para ser teleportado    price = 0, -- Dinheiro a ser cobrado para ser teleportado    {x=1063, y=880, z=7},    {x=1063, y=881, z=7},     {x=1063, y=882, z=7},     {x=1063, y=883, z=7}, }local naopode = 0function 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, 'sim') then        selfSay('You are sure you want to go? You can not return.', cid)        talkState[talkUser] = 1    elseif talkState[talkUser] == 1 then        if msgcontains(msg, 'yes') then            naopode = 0            if getPlayerLevel(cid) >= cfg.level then                for i = 1, 4 do                    if isPlayer(getThingFromPos(cfg[i]).uid) then                         naopode = 0                    else 						naopode = 1						break					end                end                 if naopode == 0 then                    if doPlayerRemoveMoney(cid, cfg.price) then                        for p = 1, 4 do                             doTeleportThing(getThingFromPos(cfg[p]), cfg.toPos)                        end                        talkState[talkUser] = 0                    else                        selfSay('You don\'t have enough money.', cid)                    end                                    else                     selfSay('Desculpe Mais Precisa de um grupo de 4 Players', cid)                    talkState[talkUser] = 0                end            else                selfSay('You need level having above '.. cfg.level ..'.', cid)            end        elseif msgcontains(msg, 'no') then            selfSay('Skirt here!', cid)        end    endendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())

 

 

Ainda Mesma Coisa :/;(:

Link para o comentário
Compartilhar em outros sites

Spoiler
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endlocal cfg = {    toPos = {x=1039, y=563, z=7}, -- Posição que o jogador sera teleportado    level = 1, -- Level necessário para ser teleportado    price = 0, -- Dinheiro a ser cobrado para ser teleportado    {x=1063, y=880, z=7},    {x=1063, y=881, z=7},     {x=1063, y=882, z=7},     {x=1063, y=883, z=7}, }local permissao = 1function 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, 'sim') then      selfSay('You are sure you want to go? You can not return.', cid)      talkState[talkUser] = 1  elseif talkState[talkUser] == 1 then    if msgcontains(msg, 'yes') then      permissao = 1      for i = 1, 4 do        if not isPlayer(getThingFromPos(cfg[i]).uid) then 		      permissao = 0		    end		    if getPlayerLevel(getThingFromPos(cfg[i]).uid) < cfg.level then           selfSay('You need level having above '.. cfg.level ..'.', cid)          talkState[talkUser] = 0        end      end       if permissao == 1 then        if doPlayerRemoveMoney(cid, cfg.price) then          for p = 1, 4 do             doTeleportThing(getThingFromPos(cfg[p]).uid, cfg.toPos)          end            talkState[talkUser] = 0        else          selfSay('You don\'t have enough money.', cid)        end      else         selfSay('Desculpe Mais Precisa de um grupo de 4 Players', cid)        talkState[talkUser] = 0      end       elseif msgcontains(msg, 'no') then      selfSay('Skirt here!', cid)    end  endendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())

 

 

Pra quem tem fé, o erro nunca tem fim.

Editado por Caronte
Link para o comentário
Compartilhar em outros sites

21 minutos atrás, Caronte disse:
  Mostrar conteúdo oculto
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endlocal cfg = {    toPos = {x=1039, y=563, z=7}, -- Posição que o jogador sera teleportado    level = 1, -- Level necessário para ser teleportado    price = 0, -- Dinheiro a ser cobrado para ser teleportado    {x=1063, y=880, z=7},    {x=1063, y=881, z=7},     {x=1063, y=882, z=7},     {x=1063, y=883, z=7}, }local permissao = 1function 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, 'sim') then      selfSay('You are sure you want to go? You can not return.', cid)      talkState[talkUser] = 1  elseif talkState[talkUser] == 1 then    if msgcontains(msg, 'yes') then      permissao = 1      for i = 1, 4 do        if not isPlayer(getThingFromPos(cfg[i]).uid) then 		      permissao = 0		    end		    if getPlayerLevel(getThingFromPos(cfg[i]).uid) < cfg.level then           selfSay('You need level having above '.. cfg.level ..'.', cid)          talkState[talkUser] = 0        end      end       if permissao == 1 then        if doPlayerRemoveMoney(cid, cfg.price) then          for p = 1, 4 do             doTeleportThing(getThingFromPos(cfg[p]).uid, cfg.toPos)          end            talkState[talkUser] = 0        else          selfSay('You don\'t have enough money.', cid)        end      else         selfSay('Desculpe Mais Precisa de um grupo de 4 Players', cid)        talkState[talkUser] = 0      end       elseif msgcontains(msg, 'no') then      selfSay('Skirt here!', cid)    end  endendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())

 

 

Pra quem tem fé, o erro nunca tem fim.

Spoiler

[13/06/2017 15:10:22] [Error - Npc interface] 

[13/06/2017 15:10:22] datapack/npc/scripts/jenny.lua:onCreatureSay

[13/06/2017 15:10:22] Description: 

[13/06/2017 15:10:22] (internalGetPlayerInfo) Player not found when requesting player info #3

[13/06/2017 15:10:22] [Error - Npc interface] 

[13/06/2017 15:10:22] datapack/npc/scripts/jenny.lua:onCreatureSay

[13/06/2017 15:10:22] Description: 

[13/06/2017 15:10:22] datapack/npc/scripts/jenny.lua:39: attempt to compare boolean with number

[13/06/2017 15:10:22] stack traceback:

[13/06/2017 15:10:22]     datapack/npc/scripts/jenny.lua:39: in function 'callback'

[13/06/2017 15:10:22]     datapack/npc/lib/npcsystem/npchandler.lua:391: in function 'onCreatureSay'

[13/06/2017 15:10:22]     datapack/npc/scripts/jenny.lua:8: in function <datapack/npc/scripts/jenny.lua:8>

 

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...