• 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 Problem script..

bolero

MikeHere
Joined
Apr 13, 2009
Messages
1,146
Reaction score
12
Location
Venezuela
Have problem

Code:
[02/05/2010 16:14:56] [Error - Action Interface] 
[02/05/2010 16:14:56] data/actions/scripts/poi_wals.lua:onUse
[02/05/2010 16:14:56] Description: 
[02/05/2010 16:14:56] (luaDoRemoveItem) Item not found

[02/05/2010 16:14:56] [Error - Action Interface] 
[02/05/2010 16:14:56] data/actions/scripts/poi_wals.lua:onUse
[02/05/2010 16:14:56] Description: 
[02/05/2010 16:14:56] (luaDoRemoveItem) Item not found

[02/05/2010 16:14:56] [Error - Action Interface] 
[02/05/2010 16:14:56] data/actions/scripts/poi_wals.lua:onUse
[02/05/2010 16:14:56] Description: 
[02/05/2010 16:14:56] (luaDoRemoveItem) Item not found

[02/05/2010 16:14:57] [Error - Action Interface] 
[02/05/2010 16:14:57] data/actions/scripts/poi_wals.lua:onUse
[02/05/2010 16:14:57] Description: 
[02/05/2010 16:14:57] (luaDoRemoveItem) Item not found

[02/05/2010 16:15:09] [Error - Action Interface] 
[02/05/2010 16:15:09] data/actions/scripts/poi_wals.lua:onUse
[02/05/2010 16:15:09] Description: 
[02/05/2010 16:15:09] (luaDoRemoveItem) Item not found

Script:

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

wallpos1 = {x=635, y=632, z=12, stackpos=1}
wall1 = getThingFromPos(wallpos1)
wallpos2 = {x=637, y=632, z=12, stackpos=1}
wall2 = getThingFromPos(wallpos2)
wallpos3 = {x=639, y=632, z=12, stackpos=1}
wall3 = getThingFromPos(wallpos3)
wallpos4 = {x=641, y=632, z=12, stackpos=1}
wall4 = getThingFromPos(wallpos4)

if item.actionid == 1000 then
	if item.itemid == 1945 then
		doTransformItem(item.uid, 1946)
		doRemoveItem(wall1.uid, 1)	
	elseif item.itemid == 1946 then
		doTransformItem(item.uid, 1945)
		doCreateItem(1304, 1, wallpos1)
	end
elseif item.actionid == 1010 then
	if item.itemid == 1945 then
		doTransformItem(item.uid, 1946)
		doRemoveItem(wall2.uid, 1)	
	elseif item.itemid == 1946 then
		doTransformItem(item.uid, 1945)
		doCreateItem(1304, 1, wallpos2)
	end
elseif item.actionid == 1011 then
	if item.itemid == 1945 then
		doTransformItem(item.uid, 1946)
		doRemoveItem(wall3.uid, 1)	
	elseif item.itemid == 1946 then
		doTransformItem(item.uid, 1945)
		doCreateItem(1304, 1, wallpos3)
	end
elseif item.actionid == 1012 then
	if item.itemid == 1945 then
		doRemoveItem(wall4.uid, 1)	
		doCreatureSay(cid, "Testing...A", TALKTYPE_ORANGE_1)
		doTransformItem(item.uid, 1946)
	elseif item.itemid == 1946 then
		doCreateItem(1304, 1, wallpos4)
		doCreatureSay(cid, "Testing...B", TALKTYPE_ORANGE_1)
		doTransformItem(item.uid, 1945)
	end
end

end
 
Code:
local t = {
	[1000] = {x=635, y=632, z=12},
	[1010] = {x=637, y=632, z=12},
	[1011] = {x=639, y=632, z=12},
	[1012] = {x=641, y=632, z=12}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i = t[item.actionid]
	if item.itemid == 1945 then
		doRemoveItem(getTileItemById(i, 1304).uid)
	else
		doCreateItem(1304, 1, i)
	end
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
 
Back
Top Bottom