• 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 AddEvent error! Help and i Rep++!

DanneZ

Web-Scripting-Design-Host
Joined
Jan 16, 2010
Messages
84
Reaction score
2
Location
Sweden
This addevent gives errors, why?
local cfg = {
timer = 15 * 60 * 1000
}
addEvent(teleportBack, cfg.timer, cid, item.uid)

Error:
[22/01/2011 02:52:05] Lua Script Error: [MoveEvents Interface]
[22/01/2011 02:52:05] data/movements/scripts/quest.lua: onStepIn

[22/01/2011 02:52:05] luaAddEvent(). callback parameter should be a function.

Help and i Rep++!

Yours DanneZ.
 
Add:
Lua:
function teleportBack(cid, id)
	if isPlayer(cid) == TRUE then
		local teleport = teleportItems[id]
		doTeleportThing(cid, teleport.position)
		doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
		if teleport.backMessage then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, teleport.backMessage)
		end
	end
end
 
I alredy got some of that script added:

function teleportBack(cid, id)

setPlayerStorageValue(cid,5210,-1)
doTeleportThing(cid, cfg.backPosition)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, cfg.backMessage)

resetPuzzle()
end

What is the error if i alredy got this script?
 
Back
Top