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

Small help in a script

Fumobix

New Member
Joined
Sep 6, 2007
Messages
154
Reaction score
0
Everything is working but the last part of creating the wall, no error but nothing happens

Lua:
local function back(params)
	doCreatItem(params.wallid, 1, params.wallpos)
	doTransformItem(params.laver, item.itemid - 1)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local corpsePos = {x=1108, y=1217, z=5, stackpos=1}
	local corpse = getThingFromPos(corpsePos)
	local corpseId = 5527

	local wallPos = {x=1110, y=1217, z=5, stackpos=1}
	local wall = getThingFromPos(wallPos)
	local wallId = 9119

	local time = 120

	if (item.itemid == 1945 and corpse.itemid == corpseId and wall.itemid == wallId) then
		doRemoveItem(corpse.uid, 1)
		doRemoveItem(wall.uid, 1)
		doTransformItem(item.uid, item.itemid + 1)
        addEvent(doRemoveTeleport, time * 60 * 1000)
		elseif (item.itemid == 1946) then
		doTransformItem(item.uid, item.itemid - 1)
	end
	return true
end

function doRemoveTeleport()
		doCreateItem(9119, 1, wallPos)
    end
 
Test it :p
Lua:
local function back(params)
        doCreatItem(params.wallid, 1, params.wallpos)
        doTransformItem(params.laver, item.itemid - 1)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local corpsePos = {x=1108, y=1217, z=5, stackpos=1}
        local corpse = getThingFromPos(corpsePos)
        local corpseId = 5527

        local wallPos = {x=1110, y=1217, z=5, stackpos=1}
        local wall = getThingFromPos(wallPos)
        local wallId = 9119

        local time = 120

        if (item.itemid == 1945 and corpse.itemid == corpseId and wall.itemid == wallId) then
                doRemoveItem(corpse.uid, 1)
                doRemoveItem(wall.uid, 1)
                doTransformItem(item.uid, item.itemid + 1)
        addEvent(doRemoveTeleport, time * 60 * 1000)
                elseif (item.itemid == 1946) then
                doTransformItem(item.uid, item.itemid - 1)
        end
        return true
end

function doRemoveTeleport()
        local wallPos = {x=1110, y=1217, z=5, stackpos=1}
                doCreateItem(9119, 1, wallPos)
    end
 
Code:
local function doCreateWall(id, pos)
	if doTileQueryAdd(doCreateItemEx(id), pos) == 1 then
		doCreateItem(id, 1, pos)
	end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local k1, k2 = {x = 1108, y = 1217, z = 5}, {x = 1110, y = 1217, z = 5}
	local it, i = getTileItemById(k1, 5527).uid, getTileItemById(k2, 9119).uid
	if item.itemid == 1945 and it > 0 and i > 0 then
		doRemoveItem(it)
		doRemoveItem(i)
		addEvent(doCreateWall, 120 * 60 * 1000, 9119, k2)
	elseif item.itemid == 1946 then doTransformItem(item.uid, item.itemid - 1) end
	return true
end
 
Back
Top