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

Some Small Questions...

SnorkY

Veteran OT User
Joined
Nov 28, 2007
Messages
1,395
Reaction score
264
Hello, Thanks for reading my thread.

Question One :

I Followed "100% Rl Tibia Soft Boots" Link.

http://******.net/showthread.php?t=66883&highlight=soft+boots

But when he came to Movements.xml it says search for 6530 and you will find

<item id="6530" name="worn leather boots">
<attribute key="weight" value="900"></attribute>

But i cant find that.

Where in Movements.xml should i put this?
Question Two

I have two soft boots scripts incase the other one doesnt work.
ME : Hi
BOT : <Welcomes Me>
ME : Soft Boots
BOT : Do you want to refill your soft boots for 10k?
ME : Yes
BOT : Sorry, You dont have that Item.

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
function onThink() npcHandler:eek:nThink() end
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)

if(npcHandler.focus ~= cid) then
return false
end

if msgcontains(msg, 'soft boots') or msgcontains(msg, 'worn soft boots') then
selfSay('Would you like your worn soft boots to be fixed? It will cost 10k.')
talk_state = 1


elseif msgcontains(msg, 'yes') and talk_state == 1 then
if getPlayerItemCount(cid,6530) >= 1 then
if doPlayerTakeItem(cid,6530,1) and pay(cid,10000) then
selfSay('Here you are.')
doPlayerAddItem(cid,6132,1)
end
else
selfSay('Sorry, you don\'t have the item.')
end


elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
selfSay('Oh? Maybe another time...')
talk_state = 0
end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModu
Second Soft boots Refiller.

ME : Hi
BOT : Welcomes Me.
ME : Soft Boots.
BOT Im specialist in soft boots, what do you bring me?
ME : Soft Boots

Nothing Happens.

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
function onThink() npcHandler:eek:nThink() end
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
-- 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.
if(npcHandler.focus ~= cid) then
return false
end

if msgcontains(msg, 'specialised') or msgcontains(msg, 'boot') then
selfSay('Yes, my fathers was a great one blacksmith, it was a wise person , but when he decided to teach me he dies and i just learn about the lovely boots. So, did you bring me some boots? which one?')
elseif msgcontains(msg, 'soft boots') or msgcontains(msg, 'worn soft boots') or msgcontains(msg, 'soft boot') or msgcontains(msg, 'worn soft boot') then
selfSay('Did u like that i fix ur worn soft boots? it will cost 100 platinum coins')
talk_state = 1


elseif msgcontains(msg, 'yes') and talk_state == 1 then
if getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2152) >= 100 then
if doPlayerTakeItem(cid,6530,1) and doPlayerTakeItem(cid,2152,100) == 0 then
selfSay('Here you are.')
doPlayerAddItem(cid,2640,1)
end
else
selfSay('Sorry, you don\'t have the item.')
end


elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
selfSay('Ok than.')
talk_state = 0
end
-- 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())
Could someone fix one of these scripts? Thanks.
 
Last edited by a moderator:
This one should work.
Code:
 local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)

if(npcHandler.focus ~= cid) then
return false
end

if msgcontains(msg, 'soft boots') or msgcontains(msg, 'worn soft boots') then
    selfSay('Would you like your worn soft boots to be fixed? It will cost 10k.')
    talk_state = 1


elseif msgcontains(msg, 'yes') and talk_state == 1 then
if getPlayerItemCount(cid,6530) >= 1 then
    if doPlayerTakeItem(cid,6530,1) and pay(cid,10000) then
        selfSay('Here you are.')
        doPlayerAddItem(cid,2640,1)
    end
else
    selfSay('Sorry, you don\'t have the item.')
end


elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
    selfSay('Oh? Maybe another time...')
    talk_state = 0
end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
hi please help me with my ot server.
i have download the map and have start the server.
i can log in to the server but here comes the problem:
When i give my otserver ip to my friends in my class they cant log into the server.
why?
please help me
thank you for help:)
 
@ Alfred next time use search function but i will answer your question you have to open the port 7171 at your router or else they will never be able.

yours Evil Hero,
 
Back
Top