Error attempt to index a nil value (field '?')


Anyone got some good idea to solve this stuff?

Try to print the coords and see what you get, so in your case do this
print(labs[id].enter.x)
print(labs[id].enter.y)
print(labs[id].enter.z)
if they all return nil then do this
print(ESX.DumpTable(labs[id].enter))
print(ESX.DumpTable(labs[id]))
Make a screen shot of the results you get in your console and post them in this form.

I think that code is missing a request from mysql where it asks a lab cordinates, how that request should be done?

I haven’t used sql for a long time so im not sure if this will work,

MySQL.Async.fetchAll(“SELECT enter FROM TABLE_NAME WHERE id = @id”, {
[‘@id’] = id
} function(result)

if result or result[1] then

    print(result)
    print(result[1])
    print(ESX.DumpTable(result))
    print(ESX.DumpTable(result[1]))

end

end)

you need to replace TABLE_NAME with the database table name, i think in your occasion it is labs or something like that. if you run this code the output should be 4 prints in the server console, can you make a screenshot of what the output is