• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Npc traveler

f@bio

Fudera Otserver
Joined
Jul 10, 2007
Messages
213
Reaction score
0
Location
Brasil
Hello friends, i need a NPC with a command AUTO TRAVEL like Rashid of RLTIBIA, i'm use this npc to go for many towns on my server, this npc stay 30 minutos on randons citys with a fixed spawn on my cities... plx help me to make this... many thx for all... rep++ for helper...
 
Some random script I found:
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local myNewPos = {
        [1] = {x=32210, y=31157, z=7},
        [2] = {x=32297, y=32831, z=7},
        [3] = {x=32574, y=32752, z=7},
        [4] = {x=33067, y=32880, z=6},
        [5] = {x=33239, y=32483, z=7},
        [6] = {x=33170, y=31810, z=6},
        [7] = {x=32328, y=31782, z=7}
        }
local TpTime = 10800 --secs
local myLastTP = 0
local a = 1

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()
        if myLastTP == 0 then
                myLastTP = os.time()
        end
        if os.difftime (os.time(), myLastTP) >= TpTime then
                myLastTP = os.time()
                doCreatureSay(getNpcCid(), "See you, now Im going to the next city!", TALKTYPE_SAY)
                doTeleportThing(getNpcCid(), myNewPos[a], FALSE)
                if (a + 1) < 7 then
                        a = a + 1
                else
                        a = 1
                end                     
        end
        if (os.clock() - talk_start) > 30 then
                if focus > 0 then
                        selfSay("I don't got all day!")
                end
                focus = 0
        end
        if focus ~= 0 then
                if getDistanceToCreature(focus) > 5 then
                        selfSay("Good bye then.")
                        focus = 0
                end
        end
                npcHandler:onThink()
end

npcHandler:addModule(FocusModule:new())
 
hum... its work for one question... NPC only travel after a player speak with him... and when i summon a npc send this error on console...

PHP:
Lua Script Error: [Npc interface]
data/npc/scripts/atuais/traveler.lua:onThink

data/npc/scripts/atuais/traveler.lua:35: attempt to perform arithmetic on global
 'talk_start' (a nil value)
stack traceback:
        data/npc/scripts/atuais/traveler.lua:35: in function <data/npc/scripts/a
tuais/traveler.lua:21>

Lua Script Error: [Npc interface]
data/npc/scripts/atuais/traveler.lua:onThink

data/npc/scripts/atuais/traveler.lua:35: attempt to perform arithmetic on global
 'talk_start' (a nil value)
stack traceback:
        data/npc/scripts/atuais/traveler.lua:35: in function <data/npc/scripts/a
tuais/traveler.lua:21>

Lua Script Error: [Npc interface]
data/npc/scripts/atuais/traveler.lua:onThink

data/npc/scripts/atuais/traveler.lua:35: attempt to perform arithmetic on global
 'talk_start' (a nil value)
stack traceback:
        data/npc/scripts/atuais/traveler.lua:35: in function <data/npc/scripts/a
tuais/traveler.lua:21>

-- When i speak with NPC he travel and close shop...

-- Other question, how to me configure this to buy itens for me???

>>>> Many thx man, you are greater friend....
 
Back
Top