• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Erase Every Item in every Stackpos, from 1 sqm on use

Tymofek

New Member
Joined
May 12, 2011
Messages
86
Reaction score
3
Location
Santiago - CHILE
i need a script to delete every item (walls, floor, stones, everything!)
in the below floor, when you use a pick on the upper floor.

so it would be like editing the pick.lua file like this.

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if((itemEx.uid <= 0 or itemEx.actionid >= 0) and isInArray({106, 354}, itemEx.itemid)) then -- on use on grass in the first floor.
		doTransformItem(itemEx.uid, 392)-- creating the hole
		doDecayItem(itemEx.uid)--hole will decay
		doSendMagicEffect(toPosition, CONST_ME_POFF) -- poff
		-------- my script ------
		local pos = toPosition -- the position where the pick was used
		pos.z = pos.z + 1 -- right there but one floor down
	    local asd = getThingFromPos(pos) -- the stones and items below
        doTransformItem(asd,2260) -- transforming the stones and items into a rune xD
       
		return true
	end


but it doesnt work -.-! i tought the position was wrong, but i change the script to "docreateItem(2260,1,pos) instead of transforming that rock (btw the rock is a 5868 item.) and it worked, so:

i need a script to erase every item in that position!!! no matter the stackpos!

Thx in advance :D
 
the solution (Thx to Cykotitan xD)

i just!!!!, had to remove the item like this:

local pos = thepos

local item = getTileItemById(pos, 5868).uid
doRemoveItem(item)


...

guess what xD

IT WORKS INSTANTLY!!!!!

i had no clue that you have to add ".uid" to make it work ;D

Thx to nobody but Cykotitan xD
and to me by posting solution instead of saying "solved"
 
Back
Top