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

Funkcja stepIn nie działa

Dopiero się ucze, jak nie chcesz to nie poprawiaj.

I tak nie działa xd
 
Lua:
local nPos = {x=398, y=1380, z=9}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if (getPlayerItemCount(cid, 1970) >= 1) then
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		doTeleportThing(cid, nPos)
		doSendMagicEffect(nPos, CONST_ME_TELEPORT)
	end

	return true
end

polecam czytanie bledow, a chociaz ich kopiowanie, bo napisac, ze cos nie dziala to moze i Sasir0, ale czy to cos pomaga????????
 
Last edited:
Napisałem własny skrypt, działa ale w połowie(pojawia się item ale nie chce zniknąć). Dopiero się uczę czy moglibyście mi podpowiedzieć co robię nie tak?

local nPos = {x=461, y=1374, z=10}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if item.uid == 10225 then
doCreateItem(1386,1,nPos)

end
end


function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if item.uid == 10225 then
doRemoveitem(1386,1,nPos)

end
return 1
end

<movevent type="StepIn" uniqueid="10225" event="script" value="PitsOfInferno/CreateLadder.lua"/>
<movevent type="StepOut" uniqueid="10225" event="script" value="PitsOfInferno/CreateLadder.lua"/>


a to błąd w konsoli gdy schodzi się z kratki:
[25/01/2010 12:44:51] ...ata/movements/scripts/PitsOfInferno/CreateLadder.lua:15: attempt to call global 'doRemoveitem' (a nil value)
[25/01/2010 12:44:51] stack traceback:
[25/01/2010 12:44:51] ...ata/movements/scripts/PitsOfInferno/CreateLadder.lua:15: in function <...ata/movements/scripts/PitsOfInferno/CreateLadder.lua:13>
 
Lua:
local item = getThingfromPos(itemPos)
doRemoveItem(item.uid)

ew.

Lua:
local item = getTileItemById(itemPos, 1386)
doRemoveItem(item.uid)
 
Probowałem różne kombinacje z tym co mi dałeś, obecnie mam taką:

local nPos = {x=461, y=1374, z=10}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if item.uid == 10225 then
doCreateItem(1386,1,nPos)

end
end


function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local item = getThingfromPos(nPos)

if item.uid == 10225 then
doRemoveItem(item.uid)

end
return 1
end
 
Lua:
local nPos = {x=461, y=1374, z=10, stackpos=1}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if item.uid == 10225 then
		doCreateItem(1386,1,nPos)
	end

	return true
end


local nPos = {x=461, y=1374, z=10, stackpos=1}

function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)

	local item = getThingfromPos(nPos)

	if item.uid == 10225 then
		doRemoveItem(item.uid)
	end

	return true
end
 
mało tych parametrów...
i w sumie, co to za różnica między from a last position?
 
@zakius:
Code:
env->streamPosition(scriptstream, "lastPosition", creature->getLastPosition(), 0);
env->streamPosition(scriptstream, "fromPosition", fromPos, 0);
 
jaki error w tym co Ci podalem? nPos = { xxxxxxxx } zamiast tych dwoch local mozna chyba dojebac, a jak nie to zrob po prostu zeby sie deklarowala juz w funkcji...
 
jaki error w tym co Ci podalem? nPos = { xxxxxxxx } zamiast tych dwoch local mozna chyba dojebac, a jak nie to zrob po prostu zeby sie deklarowala juz w funkcji...


w konsoli nie ma żadnego błędu, to wygląda tak jakby w ogóle nie czytało tego:
local item = getThingfromPos(nPos)
albo tego:
doRemoveItem(item.uid)

Juz nie wiem jak mam to zrobić :///
 
Back
Top