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

[Movement] problem with script

lenidas

New Member
Joined
Mar 18, 2010
Messages
149
Reaction score
0
Hey, I have problem with this script:
Lua:
<movevent type="StepIn" uniqueid="23420" event="script" value="final.lua"/>
Lua:
local pos = {x=33198, y=32876, z=11}
function onStepIn(cid, item, position)
	if isPlayer(cid) == TRUE then
		for i = 2335, 2341 do
			if getTileItemById(pos, i).uid < 1 then return end
		end
		for i = 2335, 2341 do
			doRemoveItem(getTileItemById(pos, i).uid)
		end
		doCreateItem(2342, 1, pos)
		doSendMagicEffect(pos, CONST_ME_FIREAREA)
		setPlayerStorageValue(cid,65498,1)
	end
end

Whats the problem?
When someone stepin on item with UID 23420 (and special item[2342] is created) then item ID 416 should transform to 417:
stepin_stepout70.png



so I tried modify this script to:
Lua:
<movevent type="StepIn" uniqueid="23420" event="script" value="final.lua"/> 
<movevent type="StepOut" uniqueid="32149" event="script" value="final.lua"/>
Lua:
local pos = {x=33198, y=32876, z=11}
local poss = {x=33198, y=32877, z=11}
function onStepIn(cid, item, position)
	if isPlayer(cid) == TRUE then
		for i = 2335, 2341 do
			if getTileItemById(pos, i).uid < 1 then return end
		end
		for i = 2335, 2341 do
			doRemoveItem(getTileItemById(pos, i).uid)
		end
		doItemSetAttribute(doCreateItem(417, 1, poss), "uid", 32149)
		doRemoveItem(23420,1)		
		doCreateItem(2342, 1, pos)
		doSendMagicEffect(pos, CONST_ME_FIREAREA)
		setPlayerStorageValue(cid,65498,1)
	end
end

function onStepOut(cid, item, pos)
    local stone_pos = {x=33198, y=32877, z=11}
    if item.uid == 32149 and isPlayer(cid) == TRUE then     
	doItemSetAttribute(doCreateItem(416, 1,stone_pos), "uid", 23420)
    end
    return true
end

But it doesn't work. Whats wrong?
 
Back
Top