我不断弹出此代码,但我不确定错误是什么。有人可以帮我弄清楚吗 - 它说它在第 64 行。抱歉,我不确定如何将它放入代码中。这是错误行代码
if ( array[j][1] < smallest ) then
smallest = array[j][1]
index = j
end
--------- [ Element Data returns ] ---------
local function getData( theElement, key )
local key = tostring(key)
if isElement(theElement) and (key) then
return exports['[ars]anticheat-system']:c_callData( theElement, tostring(key) )
else
return false
end
end
-------------- [ Scoreboard ] ---------------
local screenX, screenY = guiGetScreenSize()
local width, height = 300, 420
local x = (screenX/2) - (width/2)
local y = (screenY/2) - (height/2)
local logowidth, logoheight = 275, 275
local logox = (x/2) - (logowidth/2)
local logoy = (y/2) - (logoheight/2)
local isEventHandled = false
local page = 1
local a = { "Z", "W", "Y", "G", "H", "L", "P", "A", "B" }
function getPlayerIDTable( )
local array = { }
for key, thePlayer in ipairs ( getElementsByType("player") ) do
local playerID = tonumber( getData( thePlayer, "playerid") )
if ( playerID ) then
array[#array + 1] = { playerID, thePlayer }
end
end
for i = 1, 9 do
local j = math.random( 1, 9 )
if ( array[i] == nil ) then
array[i] = { j, a[ math.random( 1, 9 ) ] }
end
end
return array
end
local players = { }
function assemblePlayersByID( )
local array = getPlayerIDTable( )
local smallest, index, tempo
for i = 1, #array do
smallest = array[i][1]
index = i
for j = i + 1, #array do
if ( array[j][1] < smallest ) then
smallest = array[j][1]
index = j
end
end
-- flip arrays
tempo = array[i]
array[i] = array[index]
array[index] = tempo
end