• 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 createitem problems

Xluniz

New Member
Joined
Nov 21, 2008
Messages
28
Reaction score
0
anyone know whats wrong with this code? its supposed to create a stone at a position. (when using lever)

Code:
function onUse(cid, item, frompos, item2, topos)
         local pos = {626, 237, 7}
         if(item.itemid == 1946 and item.uniqueid == 5556) then
                        doCreateItem(1355, 1, pos)
         end
         
         if(item.idemid == 1945 and item.uniqueid == 5556) then
                        doRemoveItem(5556, 1)
         end
end
 
LUA:
item.uid

bb :)

If you want to remove stones etc, please use getThingFromPos(pos) :)

if so, i just made you a script :)

LUA:
-- by zonet.
function onUse(cid, item, frompos, item2, topos)
local config = {
	wallPos = { x=100, y=100, z=7}
	getWall == getThingFromPos(wallPos)
	wallId = XXXX -- put your wall id plx.
}


	if item.itemid == 1945 and config.getWall.itemid == config.wallId then
		doRemoveItem(config.getWall.uid, 1)
		doTransformItem(item.uid, item.itemid +1)
	elseif item.itemid == 1945 then
		doCreateItem(config.wallId, 1, config.wallPos)
		doTransformItem(item.uid, item.itemid -1)
	end
		return TRUE
end
 
Last edited:
Back
Top