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

fromPos toPos HELP!

iruga

#S¥Ơ'..
Joined
May 18, 2009
Messages
371
Reaction score
4
Location
Brazil
hello all.

i need a function to replace a tile for another.
example: !change = dotransformitem(tile,671)

tile = fromPos </\ toPos \/> and replace all tiles to 671.



:)
 
Untested:
LUA:
local function changeTiles(cid)

	local newTileID = 671
	local pos = getCreaturePosition(cid)

	for x = pos.x-1, pos.x+1 do
		for y = pos.y-1, pos.y+1 do
			local tpos = {x = x, y = y, z = pos.z, stackpos = STACKPOS_GROUND}
			local tile = getThingFromPos(tpos)
			if (tile) then
				doTransformItem(tile.uid, newTileID)
			end
		end
	end

end
 
Back
Top