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

Help with a simple script

Fumobix

New Member
Joined
Sep 6, 2007
Messages
154
Reaction score
0
I need to get to work the StepOut, StepIn is working fine, help please :D
The error is error luadoremove item, item not found... have tried in many different ways but i cannot get it to work, or it gives me a nill error or this one
<movevent type="StepIn" uniqueid="10225" event="script" value="spa.lua"/>
<movevent type="StepOut" uniqueid="10225" event="script" value="spa.lua"/>

Lua:
function onStepIn(cid, item, position, fromPosition)
local itemid = 1386
local pos = {x=461, y=1374, z=10, stackpos=1}
	if isPlayer(cid) == TRUE
	then 
	doCreateItem(itemid, 1, pos)
end
return true
end

function onStepOut(cid, item, position, fromPosition)
	if isPlayer(cid) == TRUE
	then 
		doRemoveItem(pos, 1)
end
return TRUE
end
 
Last edited:
Code:
local itemid = 1386
local pos = {x=461, y=1374, z=10}

function onStepIn(cid, item, position, fromPosition)
	return isPlayer(cid) == TRUE and doCreateItem(itemid, 1, pos)
end

function onStepOut(cid, item, position, fromPosition)
	return isPlayer(cid) == TRUE and doRemoveItem(getTileItemById(pos, itemid).uid)
end
 
Code:
local itemid = 1386
local pos = {x=461, y=1374, z=10}

function onStepIn(cid, item, position, fromPosition)
	return isPlayer(cid) == TRUE and doCreateItem(itemid, 1, pos)
end

function onStepOut(cid, item, position, fromPosition)
	return isPlayer(cid) == TRUE and doRemoveItem(getTileItemById(pos, itemid).uid)
end

thanks working :D
 
Back
Top