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

TFS 1.X+ [lua] npc boat is not charging the designed cost when players travel

johnsamir

Active Member
Joined
Oct 13, 2009
Messages
231
Solutions
1
Reaction score
35
Location
Nowhere
Hello I'm using this npc boat it's working but it isn't charging the cost when players travel and i got no errors in console im using tfs 1.3 8.6 downgraded by nekiro

Lua:
--------------------By Jpkulik!----------------------------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
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
-- Set the greeting message.
npcHandler:setMessage(MESSAGE_GREET, HelloText)
function onThink()                         npcHandler:onThink() end
-- OTServ event handling functions end
local function creatureSayCallback(cid, type, msg)
    
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
---------------------------------------MENSAGES CONFIG--------------------------------------------
local HelloText = 'Hello |PLAYERNAME|. Welcome to my Boat!'
local HelpText = 'Do you need help?I can tell you some {destinations}.'
local DestinationText = 'I can take you to {Carlin}, {Ab\'Dendriel}, {Venore}, {Edron}, {Port Hope}.'           
local CitysText = 'I can take you to {Carlin}, {Ab\'Dendriel}, {Venore}, {Edron}, {Port Hope}.' 
local JobText = 'Im an Captain, and this is my Boat.'                                                                 
---------------------------------------END MENSAGES CONFIG----------------------------------------

---------------------------------------CARLIN CONFIG----------------------------------------------
local CarlinPosition = {x=32387, y=31821, z=7}              ----> Destination from Carlin Boat <----
local CarlinCost = 110                          ----> Cost to Travel for Carlin    <----
carlin = true                                            ---->TRUE:Working/FALSE:Not Working<----
---------------------------------------END CARLIN CONFIG------------------------------------------

---CARLIN-----------------------------------------------------------------------------------------------------------------------------------------
local CarlinText = 'Do you seek a passage to Carlin for 110 gold coins?'
local CarlinTextNo = 'Ok, come back when you want then!'
local NoTravel = 'Sorry, i do not travel to this city..'
local CarlinLvl = 1
local CarlinPremium = false --True/false

--Carlin--
if carlin == true then
local travelNode = keywordHandler:addKeyword({'carlin'}, 
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = CarlinText })
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = CarlinPremium, level = CarlinLvl, cost = CarlinCost, destination = CarlinPosition })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = CarlinTextNo })
else
local travelNode = keywordHandler:addKeyword({'carlin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel })
end
--End Carlin--
local function addTravelKeyword(keyword, cost, destination, action)
    local travelKeyword = keywordHandler:addKeyword({keyword}, StdModule.say, {npcHandler = npcHandler, text = 'Do you seek a passage to ' .. titleCase(keyword) .. ' for |TRAVELCOST|?', cost = cost, discount = 'postman'})
        travelKeyword:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = cost, discount = 'postman', destination = destination })
        travelKeyword:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'We would like to serve you some time.', reset = true})
end


-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 

Evil Puncker

prolonged absenteeism
TFS Developer
Joined
May 30, 2009
Messages
8,039
Solutions
215
Reaction score
3,884
OP
OP
J

johnsamir

Active Member
Joined
Oct 13, 2009
Messages
231
Solutions
1
Reaction score
35
Location
Nowhere
OP
OP
J

johnsamir

Active Member
Joined
Oct 13, 2009
Messages
231
Solutions
1
Reaction score
35
Location
Nowhere
@Evil Puncker i found out that every script that i use related with boat is not checking money, it always let players for free i have made a thread, can you help me please?
 
Top