0
大家好,我的英語不好我有一個問題RunState:LUA_ERROR:字符串 「devils_catacomb」]:1:試圖調用現場`get_devil_base」(一個零值)
ERROR
SYSERR: Apr 11 14:16:12 :: RunState: LUA_ERROR: [string "devils_catacomb"]:1: attempt to call field `get_devil_base' (a nil value)
SYSERR: Apr 11 14:16:12 :: WriteRunningStateToSyserr: LUA_ERROR: quest >devils_catacomb.start click
SYSERR: Apr 11 14:12:32 :: RunState: LUA_ERROR: >locale/turkey/quest/object/state/deviltower_zone:1: attempt to indexglobal`positions' (a nil value)
SYSERR: Apr 11 14:12:32 :: WriteRunningStateToSyserr: LUA_ERROR: quest >deviltower_zone.start click
我deviltower_zone.lua
////////Error formed location/////////
function get_4floor_stone_pos()
local positions,j,t = {{368, 629}, {419, 630}, {428, 653}, {422, 679},
{395, 689}, {369, 679}, {361, 658},},number(i,7), positions[i];
for i = 1, 6 do
if (i != j) then
local t = positions[i];
positions[i] = positions[j];
positions[j] = t;
end
end
return positions
end
when 8016.kill with pc.get_map_index() >= 660000 and pc.get_map_index() <
670000 begin
d.setf("level", 4)
local positions,vid = deviltower_zone.get_4floor_stone_pos()
,d.spawn_mob(8017, positions[7][1], positions[7][2])
for i = 1, 6 do d.set_unique("fake" .. i , d.spawn_mob(8017,
positions[i][1], positions[i][2])) end
d.set_unique("real", vid)
server_loop_timer('devil_stone4_update', 10, pc.get_map_index())
server_timer('devil_stone4_fail1', 5*60, pc.get_map_index())
notice_multiline(gameforge.deviltower_zone._50_dNotice,d.notice)
end
這是沒有直接關係的問題,但你並不需要交換變量,你在Lua做的方式。你可以做'位置[i],位置[j] =位置[j],位置[i]'。這是因爲Lua評估右側,將這兩個值推送到Lua堆棧,然後將這兩個值歸入左側。 – brocoli