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

Lever removes gates...item not found help? rep++

dalan valka

New Member
Joined
Dec 20, 2007
Messages
18
Reaction score
0
heres my script



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

local wallpos1 = {x=869, y=263, z=8, stackpos=1} --- coordinates of the wall 

to be removed ---
local wallpos2 = {x=870, y=263, z=8, stackpos=1}
local wall1 = getThingfromPos(wallpos1)
local wall2 = getThingfromPos(wallpos2)
local wallID = 9485 --- item id of the wall to be removed ---


if item.uid == 9485 and item.itemid == 1945 and wall1.itemid == 9485 and 

wall2.itemid == 9485 then

doRemoveItem(wall1.uid, 1)
doRemoveItem(wall2.uid, 1)
doTransformItem(item.uid,1946)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")


elseif item.uid == 9485 and item.itemid == 1946 and wall1.itemid == 0 and 

wall2.itemid == 0  then

doCreateItem(wall1, 1, wallpos1)
doCreateItem(wall2, 1, wallpos2)
doTransformItem(item.uid,1945)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")

end

end





heres my error
[29/05/2010 23:41:34] [Error - Action Interface]
[29/05/2010 23:41:34] data/actions/scripts/quests/unholywalls.lua:onUse
[29/05/2010 23:41:34] Description:
[29/05/2010 23:41:34] (luaDoCreateItem) Item not found

[29/05/2010 23:41:34] [Error - Action Interface]
[29/05/2010 23:41:34] data/actions/scripts/quests/unholywalls.lua:onUse
[29/05/2010 23:41:34] Description:
[29/05/2010 23:41:34] (luaDoCreateItem) Item not found

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

local wallpos1 = {x=869, y=263, z=8, stackpos=1} --- coordinates of the wall 

to be removed ---
local wallpos2 = {x=870, y=263, z=8, stackpos=1}
local wall1 = getThingfromPos(wallpos1)
local wall2 = getThingfromPos(wallpos2)
local wallID = 9485 --- item id of the wall to be removed ---

if wall1.itemid == 9485 and wall2.itemid == 9485 then
doRemoveItem(wall1.uid, 1)
doRemoveItem(wall2.uid, 1)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")

elseif wall1.itemid == 0 and wall2.itemid == 0  then
doCreateItem(9485, 1, wallpos1)
doCreateItem(9485, 1, wallpos2)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")

end
 
LUA:
function onUse(cid, item, frompos, item2, topos)

local wallpos1 = {x=869, y=263, z=8, stackpos=1} --- coordinates of the wall 

to be removed ---
local wallpos2 = {x=870, y=263, z=8, stackpos=1}
local wall1 = getThingfromPos(wallpos1)
local wall2 = getThingfromPos(wallpos2)
local wallID = 9485 --- item id of the wall to be removed ---

if wall1.itemid == 9485 and wall2.itemid == 9485 then
doRemoveItem(wall1.uid, 1)
doRemoveItem(wall2.uid, 1)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")

elseif wall1.itemid == 0 and wall2.itemid == 0  then
doCreateItem(9485, 1, wallpos1)
doCreateItem(9485, 1, wallpos2)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")

end


[30/05/2010 00:27:04] [Error - LuaScriptInterface::loadFile] data/actions/scripts/quests/unholywalls.lua:20: 'end' expected (to close 'function' at line 1) near '<eof>'
[30/05/2010 00:27:04] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/unholywalls.lua)
[30/05/2010 00:27:04] data/actions/scripts/quests/unholywalls.lua:20: 'end' expected (to close 'function' at line 1) near '<eof>'
[30/05/2010 00:27:05] Reloaded actions.:confused:
 
Code:
local t = {
	[{x=869, y=263, z=8}] = 9485,
	[{x=870, y=263, z=8}] = 9485,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	for pos, id in pairs(t) do
		if item.itemid == 1945 then
			doRemoveItem(getTileItemById(pos, id).uid)
		else
			doCreateItem(id, 1, pos)
		end
	end
	doPlayerSendTextMessage(cid, 22, "Something has moved not too far away.")
	doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
	return true
end
 
Code:
local t = {
	[{x=869, y=263, z=8}] = 9485,
	[{x=870, y=263, z=8}] = 9485[B][COLOR="Red"],[/COLOR][/B]
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	for pos, id in pairs(t) do
		if item.itemid == 1945 then
			doRemoveItem(getTileItemById(pos, id).uid)
		else
			doCreateItem(id, 1, pos)
		end
	end
	doPlayerSendTextMessage(cid, 22, "Something has moved not too far away.")
	doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
	return true
end

error :d buahha xD
 
Back
Top