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

mi have problem chest and book ok

Onizuka

Member
Joined
Jul 5, 2008
Messages
2,291
Reaction score
14
hi, i have chest on map

Chest is action 2000 and xx uniqe id
ok?
In chest i have book, in book i have text
the book is no action id or uniqe id, it has nothing just text ok?

when i go player and take book from chest no txt shows? why??

help.
 
data/lib/050-function.lua
Code:
function doCopyItem(item, attributes)
	local attributes = attributes or false

	local ret = doCreateItemEx(item.itemid, item.type)
	if(attributes) then
		if(item.actionid > 0) then
			doItemSetAttribute(ret, "aid", item.actionid)
		end
[B][COLOR="red"]		local tmp = getItemAttribute(item.uid, 'text')
		if(tmp) then
			doItemSetAttribute(ret, "text", tmp)
		end[/COLOR][/B]
	end

	if(isContainer(item.uid)) then
		for i = (getContainerSize(item.uid) - 1), 0, -1 do
			local tmp = getContainerItem(item.uid, i)
			if(tmp.itemid > 0) then
				doAddContainerItemEx(ret, doCopyItem(tmp, true).uid)
			end
		end
	end

	return getThing(ret)
end
 
data/lib/050-function.lua
Code:
function docopyitem(item, attributes)
	local attributes = attributes or false

	local ret = docreateitemex(item.itemid, item.type)
	if(attributes) then
		if(item.actionid > 0) then
			doitemsetattribute(ret, "aid", item.actionid)
		end
[b][color="red"]		local tmp = getitemattribute(item.uid, 'text')
		if(tmp) then
			doitemsetattribute(ret, "text", tmp)
		end[/color][/b]
	end

	if(iscontainer(item.uid)) then
		for i = (getcontainersize(item.uid) - 1), 0, -1 do
			local tmp = getcontaineritem(item.uid, i)
			if(tmp.itemid > 0) then
				doaddcontaineritemex(ret, docopyitem(tmp, true).uid)
			end
		end
	end

	return getthing(ret)
end

me is betterrrrr
 
Back
Top