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

Problem and mystic flame

Nacke

New Member
Joined
Feb 13, 2008
Messages
79
Reaction score
0
console give one error,and someone can help.thz


PHP:
[13/02/2010 09:29:07] [Error - MoveEvents Interface] 
[13/02/2010 09:29:07] data/movements/scripts/tomb.lua:onStepIn
[13/02/2010 09:29:07] Description: 
[13/02/2010 09:29:07] attempt to index a nil value
[13/02/2010 09:29:07] stack traceback:
[13/02/2010 09:29:07] 	[C]: in function 'getTileItemById'
[13/02/2010 09:29:08] 	data/movements/scripts/tomb.lua:22: in function <data/movements/scripts/tomb.lua:19>

My script

PHP:
local config = {
	[60063] = {{x=33073, y=32589, z=13}, {x=33079,y=32589,z=13}},
	[60064] = {x=33072,y=32589,z=13},
	[60065] = {{x=33098,y=32816,z=13}, {x=33093,y=32824,z=13}},
	[60066] = {x=33097,y=32815,z=13},
	[60067] = {{x=33135,y=32682,z=12}, {x=33130,y=32683,z=12}},
	[60068] = {x=33136,y=32683,z=12},
	[60069] = {{x=33161,y=32831,z=10}, {x=33156,y=32832,z=10}},
	[60070] = {x=33162,y=32832,z=10},
	[60071] = {{x=33233,y=32692,z=13}, {x=33234,y=32687,z=13}},
	[60072] = {x=33234,y=32693,z=13},
	[60073] = {{x=33240,y=32855,z=13}, {x=33246,y=32850,z=13}},
	[60074] = {x=33239,y=32856,z=13},
	[60075] = {{x=33276,y=32552,z=14}, {x=33271,y=32553,z=14}},
	[60076] = {x=33277,y=32553,z=14},
	[60077] = {{x=33293,y=32741,z=13}, {x=33299,y=32742,z=13}},
	[60078] = {x=33292,y=32742,z=13}
}
function onStepIn(cid, item, pos, fromPosition)
	if(config[item.uid]) then
		if(type(config[item.uid]) == "table") then
			local coin = getTileItemById(config[item.uid][1], 2159).uid
			if(coin > 0) then
				doRemoveItem(coin, 1)
				doSendMagicEffect(config[item.uid][1], CONST_ME_HITBYFIRE)
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
				doTeleportThing(cid, config[item.uid][2], FALSE)
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			end
		else
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, config[item.uid], FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	end
	return TRUE
end
 
Code:
local config = {
	[60063] = {{x=33073, y=32589, z=13}, {x=33079,y=32589,z=13}},
	[60064] = {x=33072,y=32589,z=13},
	[60065] = {{x=33098,y=32816,z=13}, {x=33093,y=32824,z=13}},
	[60066] = {x=33097,y=32815,z=13},
	[60067] = {{x=33135,y=32682,z=12}, {x=33130,y=32683,z=12}},
	[60068] = {x=33136,y=32683,z=12},
	[60069] = {{x=33161,y=32831,z=10}, {x=33156,y=32832,z=10}},
	[60070] = {x=33162,y=32832,z=10},
	[60071] = {{x=33233,y=32692,z=13}, {x=33234,y=32687,z=13}},
	[60072] = {x=33234,y=32693,z=13},
	[60073] = {{x=33240,y=32855,z=13}, {x=33246,y=32850,z=13}},
	[60074] = {x=33239,y=32856,z=13},
	[60075] = {{x=33276,y=32552,z=14}, {x=33271,y=32553,z=14}},
	[60076] = {x=33277,y=32553,z=14},
	[60077] = {{x=33293,y=32741,z=13}, {x=33299,y=32742,z=13}},
	[60078] = {x=33292,y=32742,z=13}
}
function onStepIn(cid, item, pos, fromPosition)
	local i = config[item.uid]
	if i then
		if #i == 2 then
			local coin = getTileItemById(i[1], 2159).uid
			if coin > 0 then
				doRemoveItem(coin)
				doSendMagicEffect(i[1], CONST_ME_HITBYFIRE)
				doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
				doTeleportThing(cid, i[2])
				doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
			end
		else
			doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, i)
			doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
		end
	end
end
 
Back
Top