real number expected got nil.
Posted: Fri Jun 28, 2019 8:25 pm
I am trying to update a TAS Playback mod to 0.17. I run into this error and can't figure out what causes it:
I tried with mycharacter instead of myplayer in line 121, and I am 98% certain that global.myplayer is a LuaPlayer (with a single attached character) when this is being called.
The complete code for the Event/function:Code: Select all
script.on_event(defines.events.on_tick, function(event) --line 108
if commandqueue and global.running then
local tick = game.tick - global.start_tick
local myplayer = global.myplayer
local mycharacter = myplayer.character
if not myplayer.connected then
error("The runner left.")
end
if commandqueue[tick] then
for k,v in pairs(commandqueue[tick]) do
TAScommands[v[1]](v, myplayer)
end
end
myplayer.walking_state = global.walkstate --line 121
if not global.minestate then
myplayer.mining_state = {mining = false}
else
myplayer.update_selected_entity(global.minestate)
myplayer.mining_state = {mining = true, position = global.minestate}
end
if tick == max_tick then
end_of_input(myplayer)
end
end
end)