• 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!

Lua Simple Npc for NOOB

Hbraveq

Active Member
Joined
Nov 11, 2012
Messages
167
Reaction score
40
Hello everyone! I'm using othire 0.0.3 and I want to remake npc to travel to "x y z, not to "BOATPOS_TIBIA~~"
Here is script on my npc, I tried a lot, rly :p

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

function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end

local function addTravelKeyword(keyword, cost, destination, action)
local travelKeyword = keywordHandler:addKeyword({keyword}, StdModule.say, {npcHandler = npcHandler, text = 'Friends of Dalbrect are my friends too! So you are looking for a passage to the continent for |TRAVELCOST|?', cost = cost, discount = 'postman'})
travelKeyword:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = cost, destination = destination })
travelKeyword:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'We would like to serve you some time.', reset = true})
end

addTravelKeyword('continent', 20, BOATPOS_TIBIA)
addTravelKeyword('tibia', 20, BOATPOS_TIBIA)

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Hello everyone! I'm using othire 0.0.3 and I want to remake npc to travel to "x y z, not to "BOATPOS_TIBIA~~"
Here is script on my npc, I tried a lot, rly :p
have you tried {x = 100, y = 100, z = 7} in boatpos local?

exemple:

Lua:
addTravelKeyword('continent', 20, {x = 100, y = 100, z = 7})
 
Back
Top