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

Lua Book problem

Sane Mei

New Member
Joined
Feb 21, 2010
Messages
56
Reaction score
0
Well I've edited some script already in my ots because I need a book with text in it + you can get it in bookcase.

So I am trying already 2h [cuz I am bad yet in scripting ] to make this script works, and this is what I've done so far:
* I can get a book with ID - 1964, UID - 5559 and even a text in this book but the problem is:
Player "A" can normally take it from bookcase, hes getting it + he can open and see the text I wrote there, but when
Player "B" clicks on bookcase server is getting crashed.

My codes:

Actions.xml:

<action itemid="1962" script="bookinfo.lua" />

bookinfo lua code - \/

Code:
function onUse (cid, item, frompos, item2, topos)
   rw = getItemRWInfo(item.uid)
   if (rw and 1) then
   if (rw and 2) then
   doShowTextWindow(item.uid,1000,1)
   else
   doShowTextWindow(item.uid,0,0)
   end
   else
   if (item.itemid == 1962) then
   doShowTextWindow(item.uid,5559,0)
   end
   end
   
   return 1
   
   end





<action itemid="1718" script="bookquest.lua" />

bookquest lua code \/

Code:
function onUse (cid, item, frompos, item2, topos)

if (item.uid == 5555) then
queststatus = getPlayerStorageValue(cid,5555)

if (queststatus == -1) then
doPlayerSendTextMessage(cid,22,"You have found a book. The papyrus pages are sewn together with a silver thread.")
doItemSetAttribute(doPlayerAddItem(cid,1962,1), 'uid', 5559)
doSetItemText(5559, "History Of Abduzz") 
setPlayerStorageValue(cid,5555,1)
else
doPlayerSendTextMessage(cid,22,"The library is empty.")
end

return 0
end
return 1
end

And I am in really please if someone could fix it, or make a new one what works without any problems. If u would try make a new one for me ( I would be so thankful + free beer:D ) but ye, if someone could do that for me I need a book - 1962 ID with text into it and you have to get this book in bookcase with ID 1718

// Thanks.
 
@santi
Thanks seriously for your fast reply :)
But well, I checked your script already, but I need the text in a book, not in window:(
+ I can put more symbols in a book, when I tried to put my text into your script it goes crash because there is too much symbols:(
 
Last edited:
@Santi
Well I tried your script once again with more focus, I haven't noticed before that I had to add some 'end' in your scripts etc. and it's working well, changed also "PopupFYI" to book window when you press it but anyway my server is getting crashed when 2nd player tries to take this book as well, when just 1 player its okay, he can book it etc. but when 2 tries to take the book from bookcase it just crash.
I might be wrong but I guess it's because UID is dupliced or what? Do you know how to fix it, or anyone else?
 
Last edited:
The bookcase should just have 1 UID, so each player goes and takes his book.
Its really weird that you're getting debugged :S
And instead of PopUpFYI put Dialogue xD
 
@Santi
Yeah, bookcashe has got only one 1 UID what is "5114" what you have wrote, I did not change it because I have this UID free.
After making a script, first character what goes and takes a book from bookcase - it goes well etc.
But when another player wants to take it as well - it debugs :S
Yup, I've changed it already :P

/ Edit.

Alright I have fixed it somehow:p If someone needs it just pm me so I can help ya :)
 
Last edited:
Back
Top