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

How do I write inside a book?

Exura ATS

New Member
Joined
Feb 5, 2017
Messages
72
Reaction score
4
Hello ppl!

How can I write inside a book? In my server, Holy Tible is "empty" when I "use" it. So I would like to add the lines like in tibia.com:
Banor I praise your name.
Be with me in the battle.
Be my shield, let me be your sword.
I will honor the godly spark in my soul.
May it flourish and grow.
 
Solution
It's not opening the book window when I "use" the Holy Tible. ):
Ok, try remove the return true from the script since i use a similar script for an other book. and it works great but it did not have the return true. so that must be the reason it wont open the window

script should look like this
Lua:
function onUse(cid, item, frompos, item2, topos)
   if item.itemid == 1970 then
       doSetItemText(item.uid, "Banor I praise your name.\nBe with me in the battle.\nBe my shield, let me be your sword.\nI will honor the godly spark in my soul.\nMay it flourish and grow.")
   end
end
Hello ppl!

How can I write inside a book? In my server, Holy Tible is "empty" when I "use" it. So I would like to add the lines like in tibia.com:
You can make a Script when someone use/open the book this script is run
Lua:
function onUse(cid, item, frompos, item2, topos)
   if item.itemid == 1970 then
       doSetItemText(item.uid, "Banor I praise your name.\nBe with me in the battle.\nBe my shield, let me be your sword.\nI will honor the godly spark in my soul.\nMay it flourish and grow.")
       return true
   end
end
 
You can make a Script when someone use/open the book this script is run
Lua:
function onUse(cid, item, frompos, item2, topos)
   if item.itemid == 1970 then
       doSetItemText(item.uid, "Banor I praise your name.\nBe with me in the battle.\nBe my shield, let me be your sword.\nI will honor the godly spark in my soul.\nMay it flourish and grow.")
       return true
   end
end

Where do I add this script?
 
Inside your actions folder, then you edit your actions.xml

add this to Actions.xml
double check if holy tible got itemid 1970, i just took it out of my head so i might be wrong
XML:
<action itemid="1970" event="script" value="holytible.lua"/>

Thank you so much.

Double click the book in the map editor and write the text then save the map.

Thanks too bro. <3
 
Inside your actions folder, then you edit your actions.xml

add this to Actions.xml
double check if holy tible got itemid 1970, i just took it out of my head so i might be wrong
XML:
<action itemid="1970" event="script" value="holytible.lua"/>

It's not opening the book window when I "use" the Holy Tible. ):
 
Actions.xml:
Lua:
<action itemid="1970" script="other/theholytible.lua" />

theholytible.lua:
Lua:
local text = "Banor I praise your name.\nBe with me in the battle.\nBe my shield, let me be your sword.\nI will honour the godly spark in my soul.\nMay it flourish and grow"

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    player:showTextDialog(item.itemid, text)
    return true
end
 
Last edited:
It's not opening the book window when I "use" the Holy Tible. ):
Ok, try remove the return true from the script since i use a similar script for an other book. and it works great but it did not have the return true. so that must be the reason it wont open the window

script should look like this
Lua:
function onUse(cid, item, frompos, item2, topos)
   if item.itemid == 1970 then
       doSetItemText(item.uid, "Banor I praise your name.\nBe with me in the battle.\nBe my shield, let me be your sword.\nI will honor the godly spark in my soul.\nMay it flourish and grow.")
   end
end
 
Solution
Back
Top Bottom