• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Quest - Document with writing on it.

Shockah

Member
Joined
Aug 31, 2010
Messages
625
Reaction score
17
Location
England
Is it possible to get a document from a chest box or something that has writing on it? If so how do you do it?
 
Try this:
data/actions/scripts/chest.lua
LUA:
function onUse(cid, item, fromPosition, ItemEx, toPosition)
if getPlayerStorageValue(cid,storage) == -1 then
doItemSetAttribute(doPlayerAddItem(cid,writing,1), 'uid', 15880)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a writing")
else
doPlayerSendCancel(cid, "It is empty")
return true
end

Ok, so this way, you will find a writing, which will have an specified uniqueID when you get it, so

data/actions/scripts/writing.lua

LUA:
local message = blablabla
function onUse (cid,item, fromPosition, ItemEx, toPosition)
doPlayerPopupFYI(cid, message)
return true
end

data/actions/actions.xml
XML:
<action uniqueid="5114" event="script" value="chest.lua"/>
<action uniqueid="15880" event="script" value="writing.lua"/>

Try it, I think it will work but I'm not sure ;)
 
Back
Top