• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Error Attempt to index local 'file' (a nill value) stack traceback

upking

New Member
Joined
Jun 13, 2010
Messages
4
Reaction score
0
Hi, well I've made a globalevent that runs regularly to compare 2 files if one of them is different the server will shutdown
The problem is... It runs well but sometimes this error occurs and generally it end up crashing the server when the server save happens.
Here's the console screen:

2z6ceub.jpg

And this is the code I've made:

Code:
function onThink()
local file = io.open('ip.txt','r')
local ip = file:read(-1)
file:close()
local filestart = io.open('ipstart.txt','r')
local ipstart = filestart:read(-1)
filestart:close()
    if ip ~= ipstart then
        doSetGameState(GAMESTATE_SHUTDOWN)
    end
return true
end

I'm using TFS 0.4 r3884
 
Back
Top