• 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 Movement script error - StepIn StepOut

lyczos

wot.no-ip.info
Joined
Aug 31, 2007
Messages
26
Reaction score
0
Location
Europe > Poland > Lodz
Code:
local tile = 426 -- tile id
local wall = 1049	-- id of wall to remove
[COLOR="red"]local pos = {x=988, y=805, z=14} [/COLOR]-- position of wall to remove 
local wallFromPos = getThingfromPos(pos) -- get item uid

function onStepIn(cid, item, position, fromPosition, itemEx, toPosition)
	 if isPlayer(cid) then
		doRemoveItem(wallFromPos.uid, 1)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have removed the wall.")
		doTransformItem(item.uid, 425)
	
	end 
	return true
end

function onStepOut(cid, item, position, fromPosition, itemEx, toPosition)
	 if isPlayer(cid) then
		doCreateItem(wall, 1, pos)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Wall is back.")
		doTransformItem(item.uid, 426)
	
	end
	return true 
end

This line (pos) making crash. i tryed without "x", "y", "z" but always is crash...
 
Lua:
function onStepIn(cid, item, pos, fromPos)
	if isPlayer(cid) then
		doRemoveItem(getTileItemById({x=988, y=805, z=14}, 1049).uid)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have removed the wall.')
		doTransformItem(item.uid, 425)
	end
end

function onStepOut(cid, item, pos, fromPos)
	if isPlayer(cid) then
		doCreateItem(1049, 1, {x=988, y=805, z=14})
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Wall is back.')
		doTransformItem(item.uid, 426)
	end
end
 
Back
Top