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

Error With Pick!

Kippetjee

Member
Joined
Jun 17, 2009
Messages
1,197
Reaction score
11
Location
The Netherlands
Hello I have a error in my pick

Some one know the problem??

errorpick.png


Using 0.4 dev

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(itemEx.uid <= 65535 or itemEx.actionid ~= 0) and (itemEx.itemid == 354 or itemEx.itemid == 355) then
		doTransformItem(itemEx.uid, 392)
		doDecayItem(itemEx.uid)
	elseif itemEx.uid == 53118 and itemEx.itemid == 6299 then
		doTeleportThing(cid, newPosition)
		doSendMagicEffect({x=32566, y=31338, z=10}, CONST_ME_TELEPORT)
		doSendMagicEffect({x=32566, y=31338, z=10}, CONST_ME_POFF)
	elseif toPosition.x == 32551 and toPosition.y == 31379 and toPosition.z == 15 and 99 < getPlayerLevel(cid) then
		local a, b = getTileItemById({x=32551, y=31379, z=15}, 1304).uid, getTileItemById({x=32551, y=31379, z=15}, 9341).uid
		if a ~= 0 and b ~= 0 then
			doRemoveItem(a)
			doRemoveItem(b)
			for x = 32550, 32551 do
				for y = 31373, 31379 do
					if x == 32551 and 31373 < y then
						doSendMagicEffect({x=x, y=y, z=15}, CONST_ME_POFF)
					end
					doCreateItem(5815, 1, {x=32560, y=31404, z=15})
				end
			end
			doItemSetAttribute(doCreateItem(1387, 1, {x=32551, y=31376, z=15}), 'aid', 60126)
		else
			return false
		end
	elseif itemEx.itemid == 7200 then
		doTransformItem(itemEx.uid, 7236)
		doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
	elseif itemEx.uid == 3623 and getCreatureStorage(cid,42324) == 2 then
		doTeleportThing(cid, {x=33356, y=31180, z=8})
		doSendMagicEffect({x=33356, y=31180, z=8}, CONST_ME_POFF)
	elseif itemEx.itemid == 12257 and getCreatureStorage(cid,42826) == 1 then
		doPlayerAddItem(cid,12256,1)
		setPlayerStorageValue(cid, 42826, 1)		
		doCreatureSay(cid, 'The cracked part of the table lets you cut out a large chunk of wood with your pick.', TALKTYPE_ORANGE_1)
	elseif itemEx.uid == 3623 and getCreatureStorage(cid, 42324) >= 2 then
		doTeleportThing(cid, {x=33356, y=31180, z=8})
		doSendMagicEffect({x=33356, y=31180, z=8}, CONST_ME_POFF)
	elseif itemEx.uid == 3633 and getCreatureStorage(cid, 42324) >= 3 then
		doTeleportThing(cid, {x=33223, y=31100, z=8})
		doSendMagicEffect({x=33223, y=31100, z=8}, CONST_ME_POFF)
	else
		return false
	end
	return true
end
 
Alright, is this a custom script?

Because newPosition doesn't seem to be defined and without a definition the script will fail.

Lua:
elseif itemEx.uid == 53118 and itemEx.itemid == 6299 then
		doTeleportThing(cid, newPosition)
		doSendMagicEffect({x=32566, y=31338, z=10}, CONST_ME_TELEPORT)
		doSendMagicEffect({x=32566, y=31338, z=10}, CONST_ME_POFF)

It seems to me you want the player to teleport to (32566, 31338, 10) so try declaring newPosition like:

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        local newPosition = {x=32566, y=31338, z=10}
	if(itemEx.uid <= 65535 or itemEx.actionid ~= 0) and (itemEx.itemid == 354 or itemEx.itemid == 355) then
		doTransformItem(itemEx.uid, 392)
		doDecayItem(itemEx.uid)
	elseif itemEx.uid == 53118 and itemEx.itemid == 6299 then
		doTeleportThing(cid, newPosition)
		doSendMagicEffect({x=32566, y=31338, z=10}, CONST_ME_TELEPORT)
		doSendMagicEffect({x=32566, y=31338, z=10}, CONST_ME_POFF)
	elseif toPosition.x == 32551 and toPosition.y == 31379 and toPosition.z == 15 and 99 < getPlayerLevel(cid) then
		local a, b = getTileItemById({x=32551, y=31379, z=15}, 1304).uid, getTileItemById({x=32551, y=31379, z=15}, 9341).uid
		if a ~= 0 and b ~= 0 then
			doRemoveItem(a)
			doRemoveItem(b)
			for x = 32550, 32551 do
				for y = 31373, 31379 do
					if x == 32551 and 31373 < y then
						doSendMagicEffect({x=x, y=y, z=15}, CONST_ME_POFF)
					end
					doCreateItem(5815, 1, {x=32560, y=31404, z=15})
				end
			end
			doItemSetAttribute(doCreateItem(1387, 1, {x=32551, y=31376, z=15}), 'aid', 60126)
		else
			return false
		end
	elseif itemEx.itemid == 7200 then
		doTransformItem(itemEx.uid, 7236)
		doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
	elseif itemEx.uid == 3623 and getCreatureStorage(cid,42324) == 2 then
		doTeleportThing(cid, {x=33356, y=31180, z=8})
		doSendMagicEffect({x=33356, y=31180, z=8}, CONST_ME_POFF)
	elseif itemEx.itemid == 12257 and getCreatureStorage(cid,42826) == 1 then
		doPlayerAddItem(cid,12256,1)
		setPlayerStorageValue(cid, 42826, 1)		
		doCreatureSay(cid, 'The cracked part of the table lets you cut out a large chunk of wood with your pick.', TALKTYPE_ORANGE_1)
	elseif itemEx.uid == 3623 and getCreatureStorage(cid, 42324) >= 2 then
		doTeleportThing(cid, {x=33356, y=31180, z=8})
		doSendMagicEffect({x=33356, y=31180, z=8}, CONST_ME_POFF)
	elseif itemEx.uid == 3633 and getCreatureStorage(cid, 42324) >= 3 then
		doTeleportThing(cid, {x=33223, y=31100, z=8})
		doSendMagicEffect({x=33223, y=31100, z=8}, CONST_ME_POFF)
	else
		return false
	end
	return true
end

No guarantees that'll work ;/
 
Back
Top