Jalorius
Intermediate OT User
- Joined
- Sep 2, 2015
- Messages
- 62
- Reaction score
- 103
I've been trying to figure this out, but been having slight difficulty understanding why the script does not work. It works to collect the book, but there is no text inside the book. Is there a way to get this to function properly? I am using TFS 1.2 and my client version is 10.77. any ideas?
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local itemWeight = (ItemType(1955):getWeight())
local playerCap = player:getFreeCapacity()
if player:getStorageValue(2322) == -1 then
if playerCap >= itemWeight then
if item.uid == 3010 then
doSetItemText(player:addItem(1955, 1), "Day 1: Wow! I finally get to leave the village and explore the world! I am so excited to get started on my adventures! Day 2: I ventured down into a cave, wow, some neat cave drawings! I have never seen anything like this in my life! Day 3: My lungs are feeling heavy and *cough* *cough* I can't move very well *cough*. I don't know if I will ever *cough* make it...")
player:setStorageValue(2322, 1)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found a Book.")
end
elseif
playerCap < itemWeight then
player:sendTextMessage(MESSAGE_INFO_DESCR, "You do not have enough capacity.")
end
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There is nothing here.")
end
return true
end