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

Draconia Quest

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
Hey, I have been searching at forum and couldn't find anything... Haven't been using LUA for a few months and forgot somethings about it...

I was trying to get a creature (player) from a certain tile... Tried this but I think it wouldn't work since I need to check if there is another player, but Im sure that this is not working, and also I think that creating the item onStepOut wouldn't work too... Can't remember how to use stackpos.

LUA:
function onStepIn(cid, item, position, fromPosition)	local check_pos1 = x=X1,y=Y1,z=Z1,stackpos=253}	
	local check_pos2 = x=X2,y=Y2,z=Z2,stackpos=253}
	local wall = {x=X3, y=Y3, z=Z3, stackpos=2}
	local getwall = getThingfromPos(wall)


	if getTileThingByPos(check_pos) > 0 and getTileThingByPos(check_pos) > 0 then
		doRemoveItem(getwall.uid)
	else
		doCreatureSay(cid, "You need a parner on the other sqm.", TALKTYPE_ORANGE_1)
	end
	return true
end

function onStepOut(cid, item, pos)
		local item_c = 1025


		doCreateItem(item_c, 1, {x=X4, y=Y4, z=Z4, stackpos=1})
	return TRUE
end

Can someone help on this?
 
I made it now, put actionid 12345 in the tile, also change the positions too ;]

LUA:
function onStepIn(cid, item, pos)

local player_pos = {x=123, y=123, z=123, stackpos=253}
local get_player_pos = getThingfromPos(player_pos)
local wall = {x=123, y=123, z=123, stackpos=1}
local get_wall = getThingfromPos(wall)

	if item.actionid == 12345 and item.itemid == 426 and get_player_pos > 0 then
		doRemoveItem(get_wall.uid)
	else
		doCreatureSay(cid, "You need a parner on the other sqm.", TALKTYPE_ORANGE_1)
	end

	return TRUE
end

function onStepOut(cid, item, pos)

	if item.actionid == 12345 and item.itemid == 425 then
		doCreateItem(1026,1,wall)
		doTransformItem(item.uid,item.itemid+1)
	end

	return TRUE
end
 
Last edited:
Sup, thanks... But why this:


LUA:
doCreateItem(1026,1,wall)
		doTransformItem(item.uid,item.itemid+1)


It seems to create the item, then change to 1027?
 
Back
Top