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

SelfSay Error? Give a look here and Help me!

jpkulik

New Member
Joined
Mar 15, 2008
Messages
208
Reaction score
2
elseif msgcontains(msg, 'yes') and talk_state == 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Venore, TRUE)
selfSay('Have a Nice Trip!')
ense
selfSay(NoCashMsg)
end
talk_state = 0

For me It Look alright.. But i've got this error:

[11/01/2009 16:03:20] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/boat.lua
[11/01/2009 16:03:20] data/npc/scripts/boat.lua:208: '=' expected near 'selfSay'
Can someone help me fast?
Cya
 
ok, i will post the Script.. I hope some one helpme..
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)



-- OTServ event handling functions start
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
-- Set the greeting message.
npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. Where do you want to go?')
function onThink() npcHandler:eek:nThink() end
-- OTServ event handling functions end

-----------------------------------------------------------------------------Script---------------------------------------------------------------------


------------------------Destinations-----------------------------
local Venore = {x=32360, y=31782, z=7}

------------------------End of Destinations----------------------

--- Travel on? (true/false)
Travel = true
if Travel == true then
CitysMsg = 'I can take you to CITYS'
VenoreMsg = 'Do you want to go to Venore for 100 Gold Coins?'
KazordoonMsg = 'Do you want to go to Kazordoon for 100 Gold Coins?'
AbDendrielMsg = 'Do you want to go to Ab\'\Dendriel for 100 Gold Coins?'
CarlinMsg = 'Do you want to go to Carlin for 100 Gold Coins?'
SvargrondMsg = 'Do you want to go to Svargrond for 100 Gold Coins?'
LibertyBayMsg = 'Do you want to go to Liberty Bay for 100 Gold Coins?'
EdronMsg = 'Do you want to go to Edron for 100 Gold Coins?'
DarashiaMsg = 'Do you want to go to Darashia for 100 Gold Coins?'
AnkrahmunMsg = 'Do you want to go to Ankrahmun for 100 Gold Coins?'
PorthopeMsg = 'Do you want to go to Port Hope for 100 Gold Coins?'
ThaisMsg = 'Do you want to go to Port Hope for 100 Gold Coins?'
NoTravelMsg = 'Sorry, you cannot travel to this City!'
NoMsg = 'Ok Then...'
NoCashMsg = 'Sorry, you dont have any money to pay, or you are out of Premium Account Days.'
else
BoatoffMsg = 'Sorry, you cannot travel right now!'
end


----------------------Possible Mensages---------------------
if msgcontains(msg, 'citys') or msgcontains(msg, 'destination') then
selfSay(CitysMsg)
NoCashMsg = 'Sorry, you dont have any money to pay, or you are out of Premium Account Days.'
----------------------Possible Mensages End-----------------



----------------------Citys---------------------

--- Venore on? (true/false)
Venore = true
if Venore == true then
if msgcontains(msg, 'venore') then
selfSay(VenoreMsg)
talk_state = 1
else
selfSay(NoTravelMsg)
end
---End


--- Kazordoon on? (true/false)
Kazordoon = true
if Kazordooon == true then
if msgcontains(msg, 'kazordoon') then
selfSay(KazordoonMsg)
talk_state = 2
end
else
selfSay(NoTravelMsg)
end
---End


--- Carlin on? (true/false)
Carlin = true
if Carlin == true then
if msgcontains(msg, 'Carlin') then
selfSay(CarlinMsg)
talk_state = 3
end
else
selfSay(NoTravelMsg)
end
---End


--- Svargrond on? (true/false)
Svargrond = true
if Kazordooon == true then
if msgcontains(msg, 'Svargrond') then
selfSay(SvargrondMsg)
talk_state = 4
end
else
selfSay(NoTravelMsg)
end
---End


--- Libery Bay on? (true/false)
LibertyBay = true
if LiberyBay == true then
if msgcontains(msg, 'Libery Bay') then
selfSay(LiberyBayMsg)
talk_state = 5
end
else
selfSay(NoTravelMsg)
end
---End


--- Edron on? (true/false)
Edron = true
if Edron == true then
if msgcontains(msg, 'Edron') then
selfSay(EdrondMsg)
talk_state = 6
end
else
selfSay(NoTravelMsg)
end
---End


--- Darashia on? (true/false)
Darashia = true
if Darashia == true then
if msgcontains(msg, 'Darashia') then
selfSay(DarashiaMsg)
talk_state = 7
end
else
selfSay(NoTravelMsg)
end
---End


--- Ankrahmun on? (true/false)
Ankrahmun = true
if Ankrahmun == true then
if msgcontains(msg, 'Ankrahmun') then
selfSay(AnkrahmunMsg)
talk_state = 8
end
else
selfSay(NoTravelMsg)
end
---End


--- Port Hope on? (true/false)
PortHope = true
if PortHope == true then
if msgcontains(msg, 'Port Hope') then
selfSay(PortHopeMsg)
talk_state = 9
end
else
selfSay(NoTravelMsg)
end
---End

--- AbDendriel on? (true/false)
AbDendriel = true
if AbDendriel == true then
if msgcontains(msg, 'Ab Dendriel') then
selfSay(AbDendrielMsg)
talk_state = 10
end
else
selfSay(NoTravelMsg)
end
---End


--- Thais on? (true/false)
Thais = true
if Thais == true then
if msgcontains(msg, 'Thais') then
selfSay(ThaisMsg)
talk_state = 11
end
else
selfSay(NoTravelMsg)
end
---End

----------------------Citys End-----------------





----------------------Send Players---------------------
elseif msgcontains(msg, 'yes') and talk_state == 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Venore, TRUE)
selfSay('Have a Nice Trip!')
ense
selfSay(NoCashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 2 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Kazordoon, TRUE)
selfSay('Have a Nice Trip!')
ense
selfSay(NoCashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 3 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Carlin, TRUE)
selfSay('Have a Nice Trip!')
ense
selfSay(NoCashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 4 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Svargrond, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NocashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 5 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, LibertyBay, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NocashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 6 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Edron, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NocashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 7 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Darashia, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NocashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 8 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Ankrahmun, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NocashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 9 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, PortHope, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NocashMsg)
end
talk_state = 0
---
---
elseif msgcontains(msg, 'yes') and talk_state == 10 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, AbDendriel, TRUE)
selfSay('Have a Nice Trip!')
ense
selfSay(NoCashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 11 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Thais, TRUE)
selfSay('Have a Nice Trip!')
ense
selfSay(NoCashMsg)
end
talk_state = 0

------------------------------------------------ No Travel ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 10) then
selfSay(NoMsg)
talk_state = 0
end

-----------------------------------------------------------------------------Script---------------------------------------------------------------------
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Again:
UPDATED!
ELSE FIXED, BUT WON WORK YET
Code:
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, 'Hello |PLAYERNAME|. Where do you want to go?')
function onThink() 						npcHandler:onThink() end
-- OTServ event handling functions end

-----------------------------------------------------------------------------Script---------------------------------------------------------------------


------------------------Destinations-----------------------------
local Venore = {x=32360, y=31782, z=7}

------------------------End of Destinations----------------------

--- Travel on? (true/false)
Travel = true
if Travel == true then
CitysMsg = 'I can take you to CITYS'
VenoreMsg = 'Do you want to go to Venore for 100 Gold Coins?'
KazordoonMsg = 'Do you want to go to Kazordoon for 100 Gold Coins?'
AbDendrielMsg = 'Do you want to go to Ab\'\Dendriel for 100 Gold Coins?'
CarlinMsg = 'Do you want to go to Carlin for 100 Gold Coins?'
SvargrondMsg = 'Do you want to go to Svargrond for 100 Gold Coins?'
LibertyBayMsg = 'Do you want to go to Liberty Bay for 100 Gold Coins?'
EdronMsg = 'Do you want to go to Edron for 100 Gold Coins?'
DarashiaMsg = 'Do you want to go to Darashia for 100 Gold Coins?'
AnkrahmunMsg = 'Do you want to go to Ankrahmun for 100 Gold Coins?'
PorthopeMsg = 'Do you want to go to Port Hope for 100 Gold Coins?'
ThaisMsg = 'Do you want to go to Port Hope for 100 Gold Coins?'
NoTravelMsg = 'Sorry, you cannot travel to this City!'
NoMsg = 'Ok Then...'
NoCashMsg = 'Sorry, you dont have any money to pay, or you are out of Premium Account Days.'
else
BoatoffMsg = 'Sorry, you cannot travel right now!'
end


----------------------Possible Mensages---------------------
if msgcontains(msg, 'citys') or msgcontains(msg, 'destination') then
selfSay(CitysMsg)
NoCashMsg = 'Sorry, you dont have any money to pay, or you are out of Premium Account Days.'
----------------------Possible Mensages End-----------------



----------------------Citys---------------------

--- Venore on? (true/false)
Venore = true
if Venore == true then
if msgcontains(msg, 'venore') then
selfSay(VenoreMsg)
talk_state = 1
else
selfSay(NoTravelMsg)
end
---End


--- Kazordoon on? (true/false)
Kazordoon = true
if Kazordooon == true then
if msgcontains(msg, 'kazordoon') then
selfSay(KazordoonMsg)
talk_state = 2
end
else
selfSay(NoTravelMsg)
end
---End


--- Carlin on? (true/false)
Carlin = true
if Carlin == true then
if msgcontains(msg, 'Carlin') then
selfSay(CarlinMsg)
talk_state = 3
end
else
selfSay(NoTravelMsg)
end
---End


--- Svargrond on? (true/false)
Svargrond = true
if Kazordooon == true then
if msgcontains(msg, 'Svargrond') then
selfSay(SvargrondMsg)
talk_state = 4
end
else
selfSay(NoTravelMsg)
end
---End


--- Libery Bay on? (true/false)
LibertyBay = true
if LiberyBay == true then
if msgcontains(msg, 'Libery Bay') then
selfSay(LiberyBayMsg)
talk_state = 5
end
else
selfSay(NoTravelMsg)
end
---End


--- Edron on? (true/false)
Edron = true
if Edron == true then
if msgcontains(msg, 'Edron') then
selfSay(EdrondMsg)
talk_state = 6
end
else
selfSay(NoTravelMsg)
end
---End


--- Darashia on? (true/false)
Darashia = true
if Darashia == true then
if msgcontains(msg, 'Darashia') then
selfSay(DarashiaMsg)
talk_state = 7
end
else
selfSay(NoTravelMsg)
end
---End


--- Ankrahmun on? (true/false)
Ankrahmun = true
if Ankrahmun == true then
if msgcontains(msg, 'Ankrahmun') then
selfSay(AnkrahmunMsg)
talk_state = 8
end
else
selfSay(NoTravelMsg)
end
---End


--- Port Hope on? (true/false)
PortHope = true
if PortHope == true then
if msgcontains(msg, 'Port Hope') then
selfSay(PortHopeMsg)
talk_state = 9
end
else
selfSay(NoTravelMsg)
end
---End

--- AbDendriel on? (true/false)
AbDendriel = true
if AbDendriel == true then
if msgcontains(msg, 'Ab Dendriel') then
selfSay(AbDendrielMsg)
talk_state = 10
end
else
selfSay(NoTravelMsg)
end
---End


--- Thais on? (true/false)
Thais = true
if Thais == true then
if msgcontains(msg, 'Thais') then
selfSay(ThaisMsg)
talk_state = 11
end
else
selfSay(NoTravelMsg)
end
---End

----------------------Citys End-----------------





----------------------Send Players---------------------
elseif msgcontains(msg, 'yes') and talk_state == 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Venore, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NoCashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 2 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Kazordoon, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NoCashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 3 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Carlin, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NoCashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 4 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Svargrond, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NocashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 5 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, LibertyBay, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NocashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 6 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Edron, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NocashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 7 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Darashia, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NocashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 8 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Ankrahmun, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NocashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 9 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, PortHope, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NocashMsg)
end
talk_state = 0
---
---
elseif msgcontains(msg, 'yes') and talk_state == 10 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, AbDendriel, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NoCashMsg)
end
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 11 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Thais, TRUE)
selfSay('Have a Nice Trip!')
else
selfSay(NoCashMsg)
end
talk_state = 0

------------------------------------------------ No Travel ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 10) then
selfSay(NoMsg)
talk_state = 0
end

-----------------------------------------------------------------------------Script---------------------------------------------------------------------
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Last edited:
ok, i change it, but don work anyway
[11/01/2009 16:27:37] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/boat.lua
[11/01/2009 16:27:37] data/npc/scripts/boat.lua:219: '<eof>' expected near 'elseif'
 
Try this:

PHP:
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, 'Hello |PLAYERNAME|. Where do you want to go?')
function onThink() 						npcHandler:onThink() end
-- OTServ event handling functions end

-----------------------------------------------------------------------------Script---------------------------------------------------------------------


------------------------Destinations-----------------------------
local Venore = {x=32360, y=31782, z=7}

------------------------End of Destinations----------------------

--- Travel on? (true/false)
Travel = true
if Travel == true then
CitysMsg = 'I can take you to CITYS'
VenoreMsg = 'Do you want to go to Venore for 100 Gold Coins?'
KazordoonMsg = 'Do you want to go to Kazordoon for 100 Gold Coins?'
AbDendrielMsg = 'Do you want to go to Ab\'\Dendriel for 100 Gold Coins?'
CarlinMsg = 'Do you want to go to Carlin for 100 Gold Coins?'
SvargrondMsg = 'Do you want to go to Svargrond for 100 Gold Coins?'
LibertyBayMsg = 'Do you want to go to Liberty Bay for 100 Gold Coins?'
EdronMsg = 'Do you want to go to Edron for 100 Gold Coins?'
DarashiaMsg = 'Do you want to go to Darashia for 100 Gold Coins?'
AnkrahmunMsg = 'Do you want to go to Ankrahmun for 100 Gold Coins?'
PorthopeMsg = 'Do you want to go to Port Hope for 100 Gold Coins?'
ThaisMsg = 'Do you want to go to Port Hope for 100 Gold Coins?'
NoTravelMsg = 'Sorry, you cannot travel to this City!'
NoMsg = 'Ok Then...'
NoCashMsg = 'Sorry, you dont have any money to pay, or you are out of Premium Account Days.'
else
BoatoffMsg = 'Sorry, you cannot travel right now!'
end


----------------------Possible Mensages---------------------
if msgcontains(msg, 'citys') or msgcontains(msg, 'destination') then
selfSay(CitysMsg)
local NoCashMsg = 'Sorry, you dont have any money to pay, or you are out of Premium Account Days.'
----------------------Possible Mensages End-----------------

----------------------Citys---------------------

--- Venore on? (true/false)
if msgcontains(msg, 'venore') then
Venore = true
if Venore == true 
selfSay(VenoreMsg)
talk_state = 1
else
selfSay(NoTravelMsg)
end


--- Kazordoon on? (true/false)
Kazordoon = true
elseif msgcontains(msg, 'kazordoon') then
if Kazordooon == true then
selfSay(KazordoonMsg)
talk_state = 2
else
selfSay(NoTravelMsg)
end
---End


--- Carlin on? (true/false)
Carlin = true
elseif msgcontains(msg, 'Carlin') then
if Carlin == true then
selfSay(CarlinMsg)
talk_state = 3
else
selfSay(NoTravelMsg)
end
---End


--- Svargrond on? (true/false)
Svargrond = true
elseif msgcontains(msg, 'Svargrond') then
if Kazordooon == true then
selfSay(SvargrondMsg)
talk_state = 4
else
selfSay(NoTravelMsg)
end
---End


--- Libery Bay on? (true/false)
LibertyBay = true
elseif msgcontains(msg, 'Libery Bay') then
if LiberyBay == true then
selfSay(LiberyBayMsg)
talk_state = 5
else
selfSay(NoTravelMsg)
end
---End


--- Edron on? (true/false)
Edron = true
elseif msgcontains(msg, 'Edron') then
if Edron == true then
selfSay(EdrondMsg)
talk_state = 6
else
selfSay(NoTravelMsg)
end
---End


--- Darashia on? (true/false)
Darashia = true
elseif msgcontains(msg, 'Darashia') then
if Darashia == true then
selfSay(DarashiaMsg)
talk_state = 7
else
selfSay(NoTravelMsg)
end
---End


--- Ankrahmun on? (true/false)
Ankrahmun = true
elseif msgcontains(msg, 'Ankrahmun') then
if Ankrahmun == true then
selfSay(AnkrahmunMsg)
talk_state = 8
else
selfSay(NoTravelMsg)
end
---End


--- Port Hope on? (true/false)
PortHope = true
elseif msgcontains(msg, 'Port Hope') then
if PortHope == true then
selfSay(PortHopeMsg)
talk_state = 9
else
selfSay(NoTravelMsg)
end
---End

--- AbDendriel on? (true/false)
AbDendriel = true
elseif msgcontains(msg, 'Ab Dendriel') then
if AbDendriel == true then
selfSay(AbDendrielMsg)
talk_state = 10
else
selfSay(NoTravelMsg)
end
---End


--- Thais on? (true/false)
Thais = true
elseif msgcontains(msg, 'Thais') then
if Thais == true then
selfSay(ThaisMsg)
talk_state = 11
end
---End

----------------------Citys End-----------------





----------------------Send Players---------------------
elseif msgcontains(msg, 'yes') and talk_state == 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Venore, TRUE)
selfSay('Have a Nice Trip!')
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 2 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Kazordoon, TRUE)
selfSay('Have a Nice Trip!')
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 3 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Carlin, TRUE)
selfSay('Have a Nice Trip!')
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 4 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Svargrond, TRUE)
selfSay('Have a Nice Trip!')
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 5 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, LibertyBay, TRUE)
selfSay('Have a Nice Trip!')
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 6 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Edron, TRUE)
selfSay('Have a Nice Trip!')
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 7 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Darashia, TRUE)
selfSay('Have a Nice Trip!')
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 8 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Ankrahmun, TRUE)
selfSay('Have a Nice Trip!')
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 9 then
getPlayerPremiumDays(cid) >= 1 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, PortHope, TRUE)
selfSay('Have a Nice Trip!')
talk_state = 0
---
---
elseif msgcontains(msg, 'yes') and talk_state == 10 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, AbDendriel, TRUE)
selfSay('Have a Nice Trip!')
talk_state = 0
---
elseif msgcontains(msg, 'yes') and talk_state == 11 then
doPlayerRemoveMoney(cid,100)
doTeleportThing(cid, Thais, TRUE)
selfSay('Have a Nice Trip!')
talk_state = 0

------------------------------------------------ No Travel ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 10) then
selfSay(NoMsg)
talk_state = 0
else
selfSay(NoCashMsg)
end

-----------------------------------------------------------------------------Script---------------------------------------------------------------------
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Use this one then(easier):

PHP:
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
        function onThink() 						npcHandler:onThink() end
        -- OTServ event handling functions end
        
        
        -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
        local travelNode = keywordHandler:addKeyword({'carlin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to carlin for 80 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 80, destination = {x=32387, y=31820, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
	local travelNode = keywordHandler:addKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Thais for 130 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 130, destination = {x=32310, y=32210, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
	local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Venore for 90 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 90, destination = {x=32952, y=32022, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
	local travelNode = keywordHandler:addKeyword({'edron'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Edron for 70 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 70, destination = {x=33173, y=31764, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
        keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Carlin, Thais, Venore and Edron.'})
        keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
        keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to Carlin, Thais, Venore and Edron.'})
        -- Makes sure the npc reacts when you say hi, bye etc.
        npcHandler:addModule(FocusModule:new())
 
Back
Top