[HELP] Attempt to index a nil value (local "name")

Hello everyone. I was just trying to figure out this gcphone script but when i try to send a message on yellow tweets it just prints out this error in the cmd. I would be really glad if you could help me. I have been getting this error alot. I am using es_extended 2.0 and pretty much the newest version of esx_identity so i think they are the reason of this error. Help.


This is the script that is causing the error

Thanks alot for the help guys :confused:

Try like this and i recommended you to use it ESX v1-Final.

function getIdentity(source)
    local xPlayer = ESX.GetPlayerFromId(source)

    local result = MySQL.Sync.fetchAll("SELECT * FROM users WHERE identifier = @identifier", {['@identifier'] =  xPlayer.getIdentifier()})

    if result[1] ~= nil then
        local identity = result[1]

        return {
            firstname = identity['firstname'],
            lastname = identity['lastname'],
            phone_number = identity['phone_number']
        }
    else
        return nil
       end
  end

Looks like you found out the script from some leaks or is it from tebex.