So, I'm creating a desert dungeon like quest for my ot, using 0.3.6pl1.
When I try to pull the switch to teleport us to the reward room it just gives me this error:
here's the lua file
How do I fix this? :\
When I try to pull the switch to teleport us to the reward room it just gives me this error:
Code:
[21/11/2011 19:05:16] [Error - Action Interface]
[21/11/2011 19:05:16] data/actions/scripts/quests/desert.lua:onUse
[21/11/2011 19:05:16] Description:
[21/11/2011 19:05:16] data/actions/scripts/quests/desert.lua:52: attempt to compare table with number
[21/11/2011 19:05:16] stack traceback:
[21/11/2011 19:05:16] data/actions/scripts/quests/desert.lua:52: in function <data/actions/scripts/quests/desert.lua:39>
here's the lua file
Code:
local config = {
-- level needed to make the quest
level = 20,
-- if players should be able to do the quest unlimited amount of times (not conflicting quest rewards)
redo = {
status = false, -- true = unlimited, false = once
storageValue = 4535 -- only if status is false this will be used
},
-- vocation requirement, positions and item configuration
{
vocations = {1, 5}, -- sorc
itemId = 2175,
playerPos = {x=1351, y=834, z=8},
newPos = {x=1347, y=810, z=8},
itemPos = {x=1350, y=834, z=8}
},
{
vocations = {2, 6}, -- cleric
itemId = 2674,
playerPos = {x=1355, y=837, z=8},
newPos = {x=1347, y=810, z=8},
itemPos = {x=1350, y=834, z=8}
},
{
vocations = {3, 7}, -- paladin
itemId = 2455,
playerPos = {x=1359, y=834, z=8},
newPos = {x=1347, y=810, z=8},
itemPos = {x=1360, y=834, z=8}
},
{
vocations = {4, 8}, -- knight
itemId = 2376,
playerPos = {x=1355, y=830, z=8},
newPos = {x=1347, y=810, z=8},
itemPos = {x=1355, y=829, z=8}
}
}
function onUse(cid)
local players = {}
for _, v in ipairs(config) do
local player = getTopCreature(v.playerPos).uid
if isPlayer(player) == FALSE then
return doPlayerSendCancel(cid, "There are not enough players.")
elseif getPlayerLevel(player) < config.level then
players.level = true
elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
players.vocation = true
elseif config.redo.status and getPlayerStorageValue(cid, config.redo.storageValue) ~= TRUE then
players.done = true
else
if getTileItemById(v.itemPos, v.itemId) < 1 then
players.item = true
else
table.insert(players, player)
end
end
end
if players.level then
doPlayerSendCancel(cid, "All players need to be level " .. config.level .. " or above.")
elseif players.vocation then
doPlayerSendCancel(cid, "All players must stand on the correct tiles.")
elseif players.done then
doPlayerSendCancel(cid, "A player in your team has already done this quest.")
elseif players.item then
doPlayerSendCancel(cid, "All items must be on the correct positions.")
else
for k, player in ipairs(players) do
doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
doTeleportThing(player, config[k].newPos)
doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
end
end
return TRUE
end
How do I fix this? :\