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

Furniture Packages.

ZelOT

New Member
Joined
Sep 13, 2010
Messages
85
Reaction score
1
Location
Sweden
Hello!
I need help with furniture packages, which means if I buy like a wooden chair, It comes like this; 15:50 You see a furniture package. It weighs 25.00 oz. It is a kit for a wooden chair.
Now I should right click on it and it should turn into a wooden chair, problem is it doesn't.
Anybody knows how to solve the problem?
 
LUA:
local constructionKits = {[3901] = 1652, [3902] = 1658, [3903] = 1666, [3904] = 1670, [3905] = 3813, [3906] = 3817, [3907] = 3821, [3908] = 2602, [3909] = 1614, [3910] = 1615, [3911] = 1616, [3912] = 1619, [3913] = 3805, [3914] = 3807, [3915] = 1740,  [3917] = 2084, [3918] = 2095, [3919] = 3809, [3920] = 3811, [3921] = 1716, [3923] = 1774, [3926] = 2080, [3927] = 2098, [3928] = 2104, [3929] = 2101, [3931] = 2105, [3932] = 1724, [3933] = 1728, [3934] = 1732, [3935] = 1775, [3936] = 3832, [3937] = 2064, [3938] = 1750}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if fromPosition.x == CONTAINER_POSITION then
		doPlayerSendCancel(cid, "Put the construction kit on the floor first.")
	elseif getTileHouseInfo(fromPosition) == FALSE then
		doPlayerSendCancel(cid,"You may only construct this inside a house.")
	elseif constructionKits[item.itemid] ~= nil then
		doTransformItem(item.uid, constructionKits[item.itemid])
		doSendMagicEffect(fromPosition, CONST_ME_POFF)
	else
		return FALSE
	end
	return TRUE
end
 
The actual problem is that he BUYs a chair and comes as a chair, not as a kit for a chair lol
 
LUA:
local constructionKits = {[3901] = 1652, [3902] = 1658, [3903] = 1666, [3904] = 1670, [3905] = 3813, [3906] = 3817, [3907] = 3821, [3908] = 2602, [3909] = 1614, [3910] = 1615, [3911] = 1616, [3912] = 1619, [3913] = 3805, [3914] = 3807, [3915] = 1740,  [3917] = 2084, [3918] = 2095, [3919] = 3809, [3920] = 3811, [3921] = 1716, [3923] = 1774, [3926] = 2080, [3927] = 2098, [3928] = 2104, [3929] = 2101, [3931] = 2105, [3932] = 1724, [3933] = 1728, [3934] = 1732, [3935] = 1775, [3936] = 3832, [3937] = 2064, [3938] = 1750}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if fromPosition.x == CONTAINER_POSITION then
		doPlayerSendCancel(cid, "Put the construction kit on the floor first.")
	elseif getTileHouseInfo(fromPosition) == FALSE then
		doPlayerSendCancel(cid,"You may only construct this inside a house.")
	elseif constructionKits[item.itemid] ~= nil then
		doTransformItem(item.uid, constructionKits[item.itemid])
		doSendMagicEffect(fromPosition, CONST_ME_POFF)
	else
		return FALSE
	end
	return TRUE
end


Thanks this is what I needed :)

Edit: What should I write in actions.xml?
 
@Up:
XML:
<!-- Construction kits -->
	<action fromid="3901" toid="3938" event="script" value="other/constructionkits.lua"/>
	<action fromid="5086" toid="5088" event="script" value="other/constructionkits.lua"/>
	<action fromid="6114" toid="6115" event="script" value="other/constructionkits.lua"/>
	<action fromid="6372" toid="6373" event="script" value="other/constructionkits.lua"/>
	<action fromid="7960" toid="7962" event="script" value="other/constructionkits.lua"/>
	<action fromid="8692" toid="8693" event="script" value="other/constructionkits.lua"/>
	<action itemid="7503" event="script" value="other/constructionkits.lua"/>
	<action itemid="7700" event="script" value="other/constructionkits.lua"/>
 
If you're using an older server like Avesta...
XML:
	<action fromid="3901" toid="3938" script="other/constructionkits.lua"/>
	<action fromid="5086" toid="5088" script="other/constructionkits.lua"/>
	<action fromid="6114" toid="6115" script="other/constructionkits.lua"/>
	<action fromid="6372" toid="6373" script="other/constructionkits.lua"/>
	<action fromid="7960" toid="7962" script="other/constructionkits.lua"/>
	<action fromid="8692" toid="8693" script="other/constructionkits.lua"/>
	<action itemid="7503" script="other/constructionkits.lua"/>
	<action itemid="7700" script="other/constructionkits.lua"/>
 
Back
Top