tfs 0.3.6sp1 ,
Hello , the quest is:
3 guys stand on 3 stone tiles, then use the switch, then they get teleported to a quest.....but if there is someone on the quest already, they wont be able to go in.
error on console:
[16/03/2011 12:43:56] [Error - Action Interface]
[16/03/2011 12:43:56] data/actions/scripts/quests/questlvl40.luanUse
[16/03/2011 12:43:56] Description:
[16/03/2011 12:43:56] data/actions/scripts/quests/questlvl40.lua:42: bad argument #1 to 'insert' (table expected, got number)
[16/03/2011 12:43:56] stack traceback:
[16/03/2011 12:43:56] [C]: in function 'insert'
[16/03/2011 12:43:56] data/actions/scripts/quests/questlvl40.lua:42: in function <data/actions/scripts/quests/questlvl40.lua:36>
[16/03/2011 12:43:57] [Error - Action Interface]
[16/03/2011 12:43:57] data/actions/scripts/quests/questlvl40.luanUse
[16/03/2011 12:43:57] Description:
[16/03/2011 12:43:57] data/actions/scripts/quests/questlvl40.lua:111: attempt to compare number with nil
[16/03/2011 12:43:57] stack traceback:
[16/03/2011 12:43:57] data/actions/scripts/quests/questlvl40.lua:111: in function <data/actions/scripts/quests/questlvl40.lua:36>
Hello , the quest is:
3 guys stand on 3 stone tiles, then use the switch, then they get teleported to a quest.....but if there is someone on the quest already, they wont be able to go in.
Lua:
-- CONFIG --
local step1 = {
fromX = 1199,
fromY = 1050,
fromZ = 8,
--------------
toX = 1254,
toY = 1104,
toZ = 8
}
local playersOnly = "yes"
local questLevel = 40
local players_pos = {
{x = 1118, y =1045, z = 7, stackpos = 253},
{x = 1118, y =1046, z = 7, stackpos = 253},
{x = 1118, y =1047, z = 7, stackpos = 253},
}
local new_player_pos = {
{x = 1243, y = 1088, z = 8},
{x = 1244, y = 1088, z = 8},
{x = 1242, y = 1088, z = 8},
}
------------------------------------------------------
--- CONFIG END ---------------------------------------
------------------------------------------------------
function onUse(cid, item, fromPosition, itemEx, toPosition)
local all_ready, player, level = 0, 0, {}, 0
if item.itemid == 1945 then
doPlayerSendTextMessage(cid,19,"kk2.")
for i = 1, #players_pos do
table.insert(player, 0)
end--forend
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--bn
else
all_ready = all_ready+1
end--bn
end--bn
end--bn
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 --bn
else
level = level+1
end--bn
end--bn
if level == #players_pos then
if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
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--bn
else
doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
end--bn
else
doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
end--bn
else
doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
end--bn
elseif item.itemid == 1946 then
doPlayerSendTextMessage(cid,19,"kk1")
local player_room = 0
--bien1--
for x = step1.fromX, step1.toX do
for y = step1.fromY, step1.toY do
for z = step1.fromZ, step1.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
--bien1--
end --end del primer for
end--end del primer if
if player_room >= 3 then
doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")
elseif player_room == 0 then
doTransformItem(item.uid,1945)
else
doPlayerSendTextMessage(cid,19,"Tasdfasdom.")
end
return TRUE
end
error on console:
[16/03/2011 12:43:56] [Error - Action Interface]
[16/03/2011 12:43:56] data/actions/scripts/quests/questlvl40.luanUse
[16/03/2011 12:43:56] Description:
[16/03/2011 12:43:56] data/actions/scripts/quests/questlvl40.lua:42: bad argument #1 to 'insert' (table expected, got number)
[16/03/2011 12:43:56] stack traceback:
[16/03/2011 12:43:56] [C]: in function 'insert'
[16/03/2011 12:43:56] data/actions/scripts/quests/questlvl40.lua:42: in function <data/actions/scripts/quests/questlvl40.lua:36>
[16/03/2011 12:43:57] [Error - Action Interface]
[16/03/2011 12:43:57] data/actions/scripts/quests/questlvl40.luanUse
[16/03/2011 12:43:57] Description:
[16/03/2011 12:43:57] data/actions/scripts/quests/questlvl40.lua:111: attempt to compare number with nil
[16/03/2011 12:43:57] stack traceback:
[16/03/2011 12:43:57] data/actions/scripts/quests/questlvl40.lua:111: in function <data/actions/scripts/quests/questlvl40.lua:36>
Last edited: