potinho
Advanced OT User
What could be wrong with this anihilator script? Trying to change to this one to clear room after quest (when a new team goes) and prevent to enter if has a team doing, but gotting error:
2022-11-10 08:47:37 - [Error - Action Interface]
2022-11-10 08:47:37 - data/actions/scripts/annihilator.luanUse
2022-11-10 08:47:37 - Description:
2022-11-10 08:47:37 - (luaDoCreateMonster) Cannot create monster: Demon
2022-11-10 08:47:37 -
2022-11-10 08:47:37 - [Error - Action Interface]
2022-11-10 08:47:37 - data/actions/scripts/annihilator.luanUse
2022-11-10 08:47:37 - Description:
2022-11-10 08:47:37 - (luaDoCreateMonster) Cannot create monster: Demon
2022-11-10 08:47:37 -
2022-11-10 08:47:37 - [Error - Action Interface]
2022-11-10 08:47:37 - data/actions/scripts/annihilator.luanUse
2022-11-10 08:47:37 - Description:
2022-11-10 08:47:37 - (luaDoCreateMonster) Cannot create monster: Demon
2022-11-10 08:47:37 -
2022-11-10 08:47:37 - [Error - Action Interface]
2022-11-10 08:47:37 - data/actions/scripts/annihilator.luanUse
2022-11-10 08:47:37 - Description:
2022-11-10 08:47:37 - (luaDoCreateMonster) Cannot create monster: Demon
2022-11-10 08:47:37 -
2022-11-10 08:47:37 - [Error - Action Interface]
2022-11-10 08:47:37 - data/actions/scripts/annihilator.luanUse
2022-11-10 08:47:37 - Description:
2022-11-10 08:47:37 - (luaDoCreateMonster) Cannot create monster: Demon
2022-11-10 08:47:37 -
2022-11-10 08:47:37 - [Error - Action Interface]
2022-11-10 08:47:37 - data/actions/scripts/annihilator.luanUse
2022-11-10 08:47:37 - Description:
2022-11-10 08:47:37 - (luaDoCreateMonster) Cannot create monster: Demon
2022-11-10 08:47:48 -
2022-11-10 08:47:48 - [Error - Action Interface]
2022-11-10 08:47:48 - data/actions/scripts/quests/quests.luanUse
2022-11-10 08:47:48 - Description:
2022-11-10 08:47:48 - data/actions/scripts/quests/quests.lua:13: attempt to compare boolean with number
2022-11-10 08:47:48 - stack traceback:
2022-11-10 08:47:48 - data/actions/scripts/quests/quests.lua:13: in function <data/actions/scripts/quests/quests.lua:1>
2022-11-10 08:47:49 -
2022-11-10 08:47:49 - [Error - Action Interface]
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.luanUse
2022-11-10 08:47:49 - Description:
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.lua:13: attempt to compare boolean with number
2022-11-10 08:47:49 - stack traceback:
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.lua:13: in function <data/actions/scripts/quests/quests.lua:1>
2022-11-10 08:47:49 -
2022-11-10 08:47:49 - [Error - Action Interface]
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.luanUse
2022-11-10 08:47:49 - Description:
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.lua:13: attempt to compare boolean with number
2022-11-10 08:47:49 - stack traceback:
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.lua:13: in function <data/actions/scripts/quests/quests.lua:1>
2022-11-10 08:47:49 -
2022-11-10 08:47:49 - [Error - Action Interface]
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.luanUse
2022-11-10 08:47:49 - Description:
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.lua:13: attempt to compare boolean with number
2022-11-10 08:47:49 - stack traceback:
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.lua:13: in function <data/actions/scripts/quests/quests.lua:1>
2022-11-10 08:48:10 -
2022-11-10 08:48:10 - [Error - Action Interface]
2022-11-10 08:48:10 - data/actions/scripts/quests/quests.luanUse
2022-11-10 08:48:10 - Description:
2022-11-10 08:48:10 - data/actions/scripts/quests/quests.lua:13: attempt to compare boolean with number
2022-11-10 08:48:10 - stack traceback:
2022-11-10 08:48:10 - data/actions/scripts/quests/quests.lua:13: in function <data/actions/scripts/quests/quests.lua:1>
2022-11-10 08:48:12 -
2022-11-10 08:48:12 - [Error - Action Interface]
2022-11-10 08:48:12 - data/actions/scripts/quests/quests.luanUse
2022-11-10 08:48:12 - Description:
2022-11-10 08:48:12 - data/actions/scripts/quests/quests.lua:13: attempt to compare boolean with number
2022-11-10 08:48:12 - stack traceback:
2022-11-10 08:48:12 - data/actions/scripts/quests/quests.lua:13: in function <data/actions/scripts/quests/quests.lua:1>
My quests.lua
2022-11-10 08:47:37 - [Error - Action Interface]
2022-11-10 08:47:37 - data/actions/scripts/annihilator.luanUse
2022-11-10 08:47:37 - Description:
2022-11-10 08:47:37 - (luaDoCreateMonster) Cannot create monster: Demon
2022-11-10 08:47:37 -
2022-11-10 08:47:37 - [Error - Action Interface]
2022-11-10 08:47:37 - data/actions/scripts/annihilator.luanUse
2022-11-10 08:47:37 - Description:
2022-11-10 08:47:37 - (luaDoCreateMonster) Cannot create monster: Demon
2022-11-10 08:47:37 -
2022-11-10 08:47:37 - [Error - Action Interface]
2022-11-10 08:47:37 - data/actions/scripts/annihilator.luanUse
2022-11-10 08:47:37 - Description:
2022-11-10 08:47:37 - (luaDoCreateMonster) Cannot create monster: Demon
2022-11-10 08:47:37 -
2022-11-10 08:47:37 - [Error - Action Interface]
2022-11-10 08:47:37 - data/actions/scripts/annihilator.luanUse
2022-11-10 08:47:37 - Description:
2022-11-10 08:47:37 - (luaDoCreateMonster) Cannot create monster: Demon
2022-11-10 08:47:37 -
2022-11-10 08:47:37 - [Error - Action Interface]
2022-11-10 08:47:37 - data/actions/scripts/annihilator.luanUse
2022-11-10 08:47:37 - Description:
2022-11-10 08:47:37 - (luaDoCreateMonster) Cannot create monster: Demon
2022-11-10 08:47:37 -
2022-11-10 08:47:37 - [Error - Action Interface]
2022-11-10 08:47:37 - data/actions/scripts/annihilator.luanUse
2022-11-10 08:47:37 - Description:
2022-11-10 08:47:37 - (luaDoCreateMonster) Cannot create monster: Demon
2022-11-10 08:47:48 -
2022-11-10 08:47:48 - [Error - Action Interface]
2022-11-10 08:47:48 - data/actions/scripts/quests/quests.luanUse
2022-11-10 08:47:48 - Description:
2022-11-10 08:47:48 - data/actions/scripts/quests/quests.lua:13: attempt to compare boolean with number
2022-11-10 08:47:48 - stack traceback:
2022-11-10 08:47:48 - data/actions/scripts/quests/quests.lua:13: in function <data/actions/scripts/quests/quests.lua:1>
2022-11-10 08:47:49 -
2022-11-10 08:47:49 - [Error - Action Interface]
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.luanUse
2022-11-10 08:47:49 - Description:
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.lua:13: attempt to compare boolean with number
2022-11-10 08:47:49 - stack traceback:
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.lua:13: in function <data/actions/scripts/quests/quests.lua:1>
2022-11-10 08:47:49 -
2022-11-10 08:47:49 - [Error - Action Interface]
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.luanUse
2022-11-10 08:47:49 - Description:
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.lua:13: attempt to compare boolean with number
2022-11-10 08:47:49 - stack traceback:
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.lua:13: in function <data/actions/scripts/quests/quests.lua:1>
2022-11-10 08:47:49 -
2022-11-10 08:47:49 - [Error - Action Interface]
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.luanUse
2022-11-10 08:47:49 - Description:
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.lua:13: attempt to compare boolean with number
2022-11-10 08:47:49 - stack traceback:
2022-11-10 08:47:49 - data/actions/scripts/quests/quests.lua:13: in function <data/actions/scripts/quests/quests.lua:1>
2022-11-10 08:48:10 -
2022-11-10 08:48:10 - [Error - Action Interface]
2022-11-10 08:48:10 - data/actions/scripts/quests/quests.luanUse
2022-11-10 08:48:10 - Description:
2022-11-10 08:48:10 - data/actions/scripts/quests/quests.lua:13: attempt to compare boolean with number
2022-11-10 08:48:10 - stack traceback:
2022-11-10 08:48:10 - data/actions/scripts/quests/quests.lua:13: in function <data/actions/scripts/quests/quests.lua:1>
2022-11-10 08:48:12 -
2022-11-10 08:48:12 - [Error - Action Interface]
2022-11-10 08:48:12 - data/actions/scripts/quests/quests.luanUse
2022-11-10 08:48:12 - Description:
2022-11-10 08:48:12 - data/actions/scripts/quests/quests.lua:13: attempt to compare boolean with number
2022-11-10 08:48:12 - stack traceback:
2022-11-10 08:48:12 - data/actions/scripts/quests/quests.lua:13: in function <data/actions/scripts/quests/quests.lua:1>
Lua:
-- Annihilator by Shawak v2.1
-- CONFIG --
local room = { -- room with demons
fromX = 188,
fromY = 115,
fromZ = 10,
--------------
toX = 197,
toY = 121,
toZ = 10
}
local monster_pos = {
[1] = {pos = {195, 118, 10}, monster = "Demon"},
[2] = {pos = {196, 118, 10}, monster = "Demon"},
[3] = {pos = {194, 120, 10}, monster = "Demon"},
[4] = {pos = {192, 120, 10}, monster = "Demon"},
[5] = {pos = {193, 116, 10}, monster = "Demon"},
[6] = {pos = {191, 116, 10}, monster = "Demon"}
}
local players_pos = {
{x = 191, y =118, z = 9, stackpos = 253},
{x = 192, y =118, z = 9, stackpos = 253},
{x = 193, y =118, z = 9, stackpos = 253},
{x = 194, y =118, z = 9, stackpos = 253}
}
local new_player_pos = {
{x = 191, y = 118, z = 10},
{x = 192, y = 118, z = 10},
{x = 193, y = 118, z = 10},
{x = 194, y = 118, z = 10}
}
local playersOnly = "yes"
local questLevel = 100
------------------------------------------------------
--- CONFIG END ---------------------------------------
------------------------------------------------------
function onUse(cid, item, fromPosition, itemEx, toPosition)
local all_ready, monsters, player, level = 0, 0, {}, 0
if item.uid == 9006 then
for i = 1, #players_pos do
table.insert(player, 0)
end
for i = 1, #players_pos do
player[i] = getThingfromPos(players_pos[i])
if player[i].itemid > 0 then
if string.lower(playersOnly) == "yes" then
if isPlayer(player[i].uid) == TRUE then
all_ready = all_ready+1
else
monsters = monsters+1
end
else
all_ready = all_ready+1
end
end
end
if all_ready == #players_pos then
for i = 1, #players_pos do
player[i] = getThingfromPos(players_pos[i])
if isPlayer(player[i].uid) == TRUE then
if getPlayerLevel(player[i].uid) >= questLevel then
level = level+1
end
else
level = level+1
end
end
if level == #players_pos then
if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
for _, area in pairs(monster_pos) do
doCreateMonster(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
end
for i = 1, #players_pos do
doSendMagicEffect(players_pos[i], CONST_ME_POFF)
doTeleportThing(player[i].uid, new_player_pos[i], FALSE)
doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA)
doTransformItem(item.uid,1946)
end
else
doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
end
else
doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
end
else
doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
end
elseif item.itemid == 1946 then
local player_room = 0
for x = room.fromX, room.toX do
for y = room.fromY, room.toY do
for z = room.fromZ, room.toZ do
local pos = {x=x, y=y, z=z,stackpos = 253}
local thing = getThingfromPos(pos)
if thing.itemid > 0 then
if isPlayer(thing.uid) == TRUE then
player_room = player_room+1
end
end
end
end
end
elseif item.uid == 9007 then
queststatus = getPlayerStorageValue(cid,5000)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a demon armor.")
doPlayerAddItem(cid,2494,1)
setPlayerStorageValue(cid,5000,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
elseif item.uid == 9008 then
queststatus = getPlayerStorageValue(cid,5000)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a magic sword.")
doPlayerAddItem(cid,2400,1)
setPlayerStorageValue(cid,5000,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
elseif item.uid == 9009 then
queststatus = getPlayerStorageValue(cid,5000)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a stonecutter axe.")
doPlayerAddItem(cid,2431,1)
setPlayerStorageValue(cid,5000,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
elseif item.uid == 9010 then
queststatus = getPlayerStorageValue(cid,5000)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found thunder hammer.")
doPlayerAddItem(cid,2421,1)
setPlayerStorageValue(cid,5000,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
if player_room >= 1 then
doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")
elseif player_room == 0 then
for x = room.fromX, room.toX do
for y = room.fromY, room.toY do
for z = room.fromZ, room.toZ do
local pos = {x=x, y=y, z=z,stackpos = 253}
local thing = getThingfromPos(pos)
if thing.itemid > 0 then
doRemoveCreature(thing.uid)
end
end
end
end
local itemId = item.itemid
if itemId == 1945 or itemId == 1946 then
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
end
return TRUE
end
My quests.lua
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getBooleanFromString(getConfigValue('enableProtectionQuestForGM'))) then
if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF, cid)
return true
end
end
if item.uid > 1000 and item.uid < 11395 then
local itemWeight = getItemWeightById(item.uid, 1)
local playerCap = getPlayerFreeCap(cid)
if getPlayerStorageValue(cid, item.uid) == -1 then
if playerCap >= itemWeight then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
doPlayerAddItem(cid, item.uid , 1)
setPlayerStorageValue(cid, item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
end
else
return false
end
return true
end