Ir para conteúdo
  • 0

Npc que não funciona


luciano0223

Pergunta

Boa tarde galera, eu venho aqui (denovo) pedindo ajuda para um npc 

 

o erro é o seguinte 



[16:40:41.828] [Error - LuaInterface::loadFile] data/npc/scripts/royalDuner.lua:40: '}' expected near 'y'
[16:40:41.829] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/royalDuner.lua
[16:40:41.829] data/npc/scripts/royalDuner.lua:40: '}' expected near 'y'


 

O script do npc é esse

 

-- [[ Feito por Anderson (BomBa)]]

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


local msgs = {
"May my enemies be strong and brave so that I feel no remorse for defeating them",
"You should ask yourself a question: 'Am I lucky?",
"It was never heard that a brave son had been born to a fearful father.",
"Never start a fight, but always finish it.",
"I wonder what would be better, be feared or respected? It would be too much to ask  two. ",
}


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


local function greet(cid)
    return false
end


function onThink()
    local pos = getCreaturePosition(getNpcCid())
    -- indo
    if getGlobalStorageValue(waypoint_royalDuner) <= 0 then
        doTeleportThing(getNpcCid(), {x=1388, y=812, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 1)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 1 then
        doTeleportThing(getNpcCid(), {x=1389, y=812, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 2)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 2 then
        doTeleportThing(getNpcCid(), {x=1390, y=812, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 3)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 3 then
        doTeleportThing(getNpcCid(), {x=1390, y=813, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 4)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 4 then
        doTeleportThing(getNpcCid(), {x=1391 y=813, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 5)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 5 then
        doTeleportThing(getNpcCid(), {x=1392, y=813, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 6)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 6 then
        doTeleportThing(getNpcCid(), {x=1393, y=813, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 7)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 7 then
        doTeleportThing(getNpcCid(), {x=1394, y=813, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 8):
    elseif getGlobalStorageValue(waypoint_royalDuner) == 8 then
        doTeleportThing(getNpcCid(), {x=1395, y=813, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 9)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 9 then
        doTeleportThing(getNpcCid(), {x=1396, y=813, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 10)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 10 then
        doTeleportThing(getNpcCid(), {x=1397, y=813, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 11)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 11 then
        doTeleportThing(getNpcCid(), {x=1398, y=813, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 12)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 12 then
        doTeleportThing(getNpcCid(), {x=1399, y=813, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 13)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 13 then
        doTeleportThing(getNpcCid(), {x=1399, y=812, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 14)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 14 then
        doTeleportThing(getNpcCid(), {x=1399, y=811, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 15)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 15 then
        doTeleportThing(getNpcCid(), {x=1400, y=811, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 16)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 16 then
        doTeleportThing(getNpcCid(), {x=1400, y=810, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 17)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 17 then
        doTeleportThing(getNpcCid(), {x=1400, y=809, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 18)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 18 then
        doTeleportThing(getNpcCid(), {x=1400, y=808, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 19)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 19 then
        doTeleportThing(getNpcCid(), {x=1401, y=808, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 20)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 20 then
        doTeleportThing(getNpcCid(), {x=1401, y=807, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 21)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 21 then
        doTeleportThing(getNpcCid(), {x=1402, y=807, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 22)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 22 then
        doTeleportThing(getNpcCid(), {x=1403, y=807, z=7}, true)
        doCreatureSetLookDir(getNpcCid(), WEST)
        setGlobalStorageValue(waypoint_royalDuner, 23)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 23 then
        doTeleportThing(getNpcCid(), {x=1404, y=807, z=7}, true)
        doCreatureSetLookDir(getNpcCid(), WEST)
        setGlobalStorageValue(waypoint_royalDuner, 24)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 24 then
        doTeleportThing(getNpcCid(), {x=1405, y=807, z=7}, true)
        doCreatureSetLookDir(getNpcCid(), WEST)
        setGlobalStorageValue(waypoint_royalDuner, 25)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 25 then
        doTeleportThing(getNpcCid(), {x=1406, y=807, z=7}, true)
        doCreatureSetLookDir(getNpcCid(), WEST)
        setGlobalStorageValue(waypoint_royalDuner, 26)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 26 then
        doTeleportThing(getNpcCid(), {x=1407, y=807, z=7}, true)
        doCreatureSetLookDir(getNpcCid(), WEST)
        setGlobalStorageValue(waypoint_royalDuner, 27)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 27 then
        doTeleportThing(getNpcCid(), {x=1408, y=807, z=7}, true)
        doCreatureSetLookDir(getNpcCid(), WEST)
        setGlobalStorageValue(waypoint_royalDuner, 28)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 28 then
        doTeleportThing(getNpcCid(), {x=1409, y=807, z=7}, true)
        doCreatureSetLookDir(getNpcCid(), WEST)
        addEvent(setGlobalStorageValue, 20000, waypoint_royalDuner, 29)


    -- voltando
    elseif getGlobalStorageValue(waypoint_royalDuner) == 29 then
        doTeleportThing(getNpcCid(), {x=1409, y=807, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 29)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 30 then
        doTeleportThing(getNpcCid(), {x=1408, y=807, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 30)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 31 then
        doTeleportThing(getNpcCid(), {x=1407, y=807, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 31)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 32 then
        doTeleportThing(getNpcCid(), {x=1406, y=807, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 32)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 33 then
        doTeleportThing(getNpcCid(), {x=1404, y=807, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 33)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 34 then
        doTeleportThing(getNpcCid(), {x=1403, y=807, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 34)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 35 then
        doTeleportThing(getNpcCid(), {x=1402, y=807, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 35)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 36 then
        doTeleportThing(getNpcCid(), {x=1401, y=807, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 36)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 37 then
        doTeleportThing(getNpcCid(), {x=1401, y=808, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 37)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 38 then
        doTeleportThing(getNpcCid(), {x=1400, y=808, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 38)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 39 then
        doTeleportThing(getNpcCid(), {x=1400, y=809, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 39)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 40 then
        doTeleportThing(getNpcCid(), {x=1400, y=810, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 40)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 41 then
        doTeleportThing(getNpcCid(), {x=1400, y=811, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 41)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 42 then
        doTeleportThing(getNpcCid(), {x=1399, y=811, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 42)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 43 then
        doTeleportThing(getNpcCid(), {x=1399, y=812, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 43)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 44 then
        doTeleportThing(getNpcCid(), {x=1399, y=813, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 44)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 45 then
        doTeleportThing(getNpcCid(), {x=1398, y=813, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 45)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 46 then
        doTeleportThing(getNpcCid(), {x=1397, y=813, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 46)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 47 then
        doTeleportThing(getNpcCid(), {x=1396, y=813, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 47)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 48 then
        doTeleportThing(getNpcCid(), {x=1395, y=813, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 48)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 49 then
        doTeleportThing(getNpcCid(), {x=1394, y=813, z=7}, true)
        setGlobalStorageValue(waypoint_royalDuner, 49)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 50 then
        doTeleportThing(getNpcCid(), {x=1393, y=813, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 50)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 51 then
        doTeleportThing(getNpcCid(), {x=1392, y=813, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 51)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 52 then
        doTeleportThing(getNpcCid(), {x=1391, y=813, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 52)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 53 then
        doTeleportThing(getNpcCid(), {x=1390, y=813, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 53)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 54 then
        doTeleportThing(getNpcCid(), {x=1389, y=813, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 54)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 55 then
        doTeleportThing(getNpcCid(), {x=1388, y=813, z=6}, true)
        setGlobalStorageValue(waypoint_royalDuner, 55)
    elseif getGlobalStorageValue(waypoint_royalDuner) == 56 then
        doTeleportThing(getNpcCid(), {x=1388, y=812, z=6}, true)
        doCreatureSetLookDir(getNpcCid(), SOUTH)
        addEvent(setGlobalStorageValue, 20000, waypoint_royalDuner, 0)
    end


    -- falas
    local falarA = math.random(1, 100000)
    if falarA <= 500 then
        doCreatureSay(getNpcCid(), msgs[math.random(#msgs)], TALKTYPE_SAY)
    end


    return true
end


npcHandler:addModule(FocusModule:new())
npcHandler:setCallback(CALLBACK_GREET, greet)


 

 

 

 

Obrigado desde já! Rep+

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

×
×
  • Criar Novo...