• 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 removing ladder

Joined
Dec 22, 2007
Messages
1,984
Reaction score
2
Hello, I've edited some script. It should create and remove ladder, but it doesn't remove. Ladder is created correctly, but then the sqm under player is removed. What's done wrong?
LUA:
ladder_pos = {x=32902, y=32283, z=12}
local ladder = getThingfromPos(ladder_pos)

function onStepIn(cid, item, pos)
	if item.uid == 10055 and isPlayer(cid) == TRUE then
		doCreateItem(5543,1,ladder_pos)
	end
	return true
end

function onStepOut(cid, item, pos)
       if item.uid == 10055 and isPlayer(cid) == TRUE then              
		doRemoveItem(ladder.uid)
        end
        return true
end
 
Most likely because you're lacking stackpos, thus it targets the ground square (stackpos = 0) rather than the ladded which is most likely on stackpos = 1.

Try replacing

LUA:
ladder_pos = {x=32902, y=32283, z=12}

with

LUA:
ladder_pos = {x=32902, y=32283, z=12, stackpos=1}

And if it doesn't work then try increasing stackpos until it does.
 
Back
Top