• 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 How to create an item in X position and check if item is there?

Gattaca

OTLand's Developer
Joined
Mar 13, 2009
Messages
158
Reaction score
2
Location
Venezuela
Hello.
Edit. i solved the "doCreateItem(id, type/count, pos)".
Now this:

I am lua programmer, but i forget all about using this function, and i tryed searching into the DOCS of the forgotten server, and found nothing relationated to "doCheckitemPosition" for checking if item id 4788 is on x, y, z.

If anyone knows how can i make this function please?.

gattaca.
 
Code:
doCreateItem(id, 4788, pos)
if isMoveable(uid)==true then

I think this should work. You can also use:

Code:
doCreateItem(id, 4788, pos)
if item.itemid == 4788 then
 
LUA:
local position = {x = XXX, y = YYY, z = Z, stackpos = 1}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doCreateItem(1304, 1, position)
	if getThingfromPos(position).itemid == 1304 then
		-- item is created successfully
	else
		-- item is NOT created successfully at desired position
	end
	return TRUE
end
 
Back
Top