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

Solved StepIn Error

Majeski20

New Member
Joined
Apr 21, 2008
Messages
602
Reaction score
4
Location
Sweden
Hello, i have some problems with my script.

When my event has started, and a player is trying to enter the arena he should bounce back.
But he doesnt.

Script
Lua:
function onStepIn(cid, item, frompos, itemEx, topos)
if item.actionid == 7795 then
	doTeleportThing(cid, {x=1122,y=923,z=7})
elseif item.actionid == 7796 then
	doTeleportThing(cid, fromPosition, true)
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
	doPlayerSendCancel(cid, "You cannot enter.")
end
return true
end

Here's the error:

Code:
[14:54:36.452] [Error - MoveEvents Interface]
[14:54:36.454] data/movements/scripts/zombieevent/movezombieevent.lua:onStepIn
[14:54:36.458] Description:
[14:54:36.459] attempt to index a nil value
[14:54:36.460] stack traceback:
[14:54:36.461]  [C]: in function 'doTeleportThing'
[14:54:36.463]  ...ta/movements/scripts/zombieevent/movezombieevent.lua:5: in fu
nction <...ta/movements/scripts/zombieevent/movezombieevent.lua:1>
 
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition)

	if item.actionid == 7795 then
		doTeleportThing(cid, {x=1122,y=923,z=7})
	elseif item.actionid == 7796 then
		doTeleportThing(cid, fromPosition)
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
		doPlayerSendCancel(cid, "You cannot enter.")
	end
	return true
end
 
@up be first =P In this situation sorry for spam.
I'm not good in lua but why here
Code:
function onStepIn(cid, item, frompos, itemEx, topos)
is frompos, and here is FromPosition
 
I scripted this thingy and problem is with the function yea.

already fixed a while ago but he did not login his main acc :eek:

Lua:
function onStepIn(cid, item, fromPosition, position, itemEx, toPosition)
if item.actionid == 7795 then
	doTeleportThing(cid, {x=0,y=0,z=0})
elseif item.actionid == 7796 then
	doTeleportThing(cid, fromPosition, true)
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
	doPlayerSendCancel(cid, "You cannot enter.")
end
return true
end
 
I scripted this thingy and problem is with the function yea.

already fixed a while ago but he did not login his main acc :eek:

Lua:
function onStepIn(cid, item, fromPosition, position, itemEx, toPosition)
if item.actionid == 7795 then
	doTeleportThing(cid, {x=0,y=0,z=0})
elseif item.actionid == 7796 then
	doTeleportThing(cid, fromPosition, true)
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
	doPlayerSendCancel(cid, "You cannot enter.")
end
return true
end

@up be first =P In this situation sorry for spam.
I'm not good in lua but why here
Code:
function onStepIn(cid, item, frompos, itemEx, topos)
is frompos, and here is FromPosition

Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition)

	if item.actionid == 7795 then
		doTeleportThing(cid, {x=1122,y=923,z=7})
	elseif item.actionid == 7796 then
		doTeleportThing(cid, fromPosition)
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
		doPlayerSendCancel(cid, "You cannot enter.")
	end
	return true
end

Thanks Limos, works perfectly.
 
Back
Top Bottom