• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Simple Npc for NOOB

Hbraveq

Banned User
Joined
Nov 11, 2012
Messages
210
Reaction score
52
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: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

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