[Help] Error with nil value but it seems script does read the value properly

Okay so I have several errors in the console about the same thing:
Error loading script server/main.lua in resource esx_extraitems: server/main.lua:15: attempt to call a nil value (global ‘xPlayer’)

server.lua

local _source 				= source
local xPlayer 				= ESX.GetPlayerFromId(_source) -- << THIS gives the error, but still works fine
local xSilencer 			= xPlayer.getInventoryItem('silencer')

Script still works fine, it properly check the player inventory for certain item, but why the console gives that error and say this is nil? :thinking: