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

action problem rep ++

mamutebr

New Member
Joined
May 17, 2008
Messages
10
Reaction score
0
I'm with my problem in action

when I click on the lever I'm not teleported and generates this error



[16/09/2009 11:20:42] Lua Script Error: [Action Interface]
[16/09/2009 11:20:42] data/actions/scripts/quests/arena.lua:onUse

[16/09/2009 11:20:42] data/actions/scripts/quests/arena.lua:44: attempt to index field '?' (a number value)
[16/09/2009 11:20:42] stack traceback:
[16/09/2009 11:20:42] data/actions/scripts/quests/arena.lua:44: in function <data/actions/scripts/quests/arena.lua:24>


arena.lua

PHP:
local config = {
	daily = "yes",
	level = 1,
	storage = 4321
}

local playerPosition =
{

	{x = 136, y = 47, z = 7}
}

local newPosition =
{

	{x = 130, y = 47, z = 7}
}

-- Do not modify the declaration lines below.
local players = {}
local failed = true
config.daily = getBooleanFromString(config.daily)

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid == 1946) then
		if(config.daily) then
			doPlayerSendCancel(cid, "Sorry, not possible.")
		else
			doTransformItem(item.uid, item.itemid - 1)
		end

		return true
	end

	if(item.itemid ~= 1945) then
		return true
	end

	for i, pos in ipairs(playerPosition) do
		pos.stackpos = STACKPOS_TOP_CREATURE
		players[i] = getThingFromPos(playerPosition[i]).uid
		if(players[i] > 0 and
			isPlayer(players[i]) and
			getPlayerStorageValue(players[i].uid, config.storage) == -1 and
			getPlayerLevel(players[i].uid) >= config.level)
		then
			failed = false
		end

		if(failed) then
			doPlayerSendCancel(cid, "Sorry, not possible.")
			return true
		end

		failed = true
	end

	for i, pid in ipairs(players) do
		doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
		doTeleportThing(pid, newPosition[i], false)
		doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)
	end

	doTransformItem(item.uid, item.itemid + 1)
	return true
end

Please anyone help me ?

i rep ++
 
Back
Top