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

Boat NPC Error

Nottinghster

Tibia World RPG Developer
Joined
Oct 24, 2007
Messages
1,619
Solutions
6
Reaction score
539
Location
Brazil - Rio de Janeiro
GitHub
Nottinghster
Hello Guys!

I tried to create another example of boat npc to my Server and I can't make it work.
I don't know what the fuck I did wrong :D

Explaining:

When I say 'Thais' the npc ask if I want to travel and blah blah blah, when I say 'yes', he say that I don't have enough money :mad:

Here is the code:

Code:
if msgcontains(msg, 'thais') then
npcHandler:say('Do you seek a passage to Thais for 110 gold?')
talk_state = 1

elseif msgcontains(msg,'yes') and talk_state == 1 then
	if isPremium(cid) == TRUE then
		if hasCondition(cid, CONDITION_INFIGHT) == TRUE then
			if getPlayerMoney(cid) >= 130 then
				selfSay('Set the sails!')
				doPlayerRemoveMoney(cid, 130)
				doTeleportThing(cid, {x=32312,y=32211,z=6, stackpos=0})
				doSendMagicEffect(getCreaturePosition(cid), 10)
				end
			else
			npcHandler:say('You don\'t have enough money.')
			end
		else
		npcHandler:say('First get rid of those blood stains! You are not going to ruin my vehicle!')
		end
	else
	npcHandler:say('I\'m sorry, but you need a premium account in order to travel onboard our ships.')
end
 
You had an end in the wrong place, here's an updated bit, should work:

LUA:
if msgcontains(msg, 'thais') then
	npcHandler:say('Do you seek a passage to Thais for 110 gold?')
	talk_state = 1

elseif msgcontains(msg,'yes') and talk_state == 1 then
	if isPremium(cid) then
		if hasCondition(cid, CONDITION_INFIGHT) then
			if getPlayerMoney(cid) >= 130 then
				selfSay('Set the sails!')
				doPlayerRemoveMoney(cid, 130)
				doTeleportThing(cid, {x=32312,y=32211,z=6, stackpos=0})
				doSendMagicEffect(getCreaturePosition(cid), 10)
			else
				npcHandler:say('You don\'t have enough money.')
			end
		else
			npcHandler:say('First get rid of those blood stains! You are not going to ruin my vehicle!')
		end
	else
		npcHandler:say('I\'m sorry, but you need a premium account in order to travel onboard our ships.')
	end
end

Edit: Pretty sure you don't need the == TRUE parts :P
 
Back
Top