Hello,
I bought this script as well as the tattoo shop, both give me a console error:
[script:barberjob-esx] SCRIPT ERROR: @barberjob-esx/server/server.lua:59: attempt to index a nil value (local 'xPlayer')
[script:tattoojob-esx] SCRIPT ERROR: @tattoojob-esx/server/server.lua:71: attempt to index a nil value (local 'xPlayer')
Here are the corresponding lines
@barberjob-esx/server/server.lua:59
AddEventHandler('playerDropped', function (reason)
local xPlayer = ESX.GetPlayerFromId(source)
for k, v in pairs(barber) do
if v.owner == xPlayer.identifier then
MySQL.Async.execute('UPDATE barber SET shop=@shop, owner=@owner, employes=@employes, money=@money WHERE id = @id', {
['@id'] = k,
['@owner'] = v.owner,
['@money'] = v.money,
['@employes'] = json.encode(v.employes),
['@shop'] = json.encode(v.shop)
})
end
end
end)
@tattoojob-esx/server/server.lua:71
AddEventHandler('playerDropped', function (reason)
local xPlayer = ESX.GetPlayerFromId(source)
if playerTattoos[source] ~= nil then
MySQL.Async.execute('UPDATE users SET tattoos=@tattoos WHERE identifier = @identifier', {
['@identifier'] = xPlayer.identifier,
['@tattoos'] = json.encode(playerTattoos[source]),
})
end
for k, v in pairs(tattoo) do
if v.owner == xPlayer.identifier then
MySQL.Async.execute('UPDATE tattoo SET shop=@shop, owner=@owner, employes=@employes, money=@money WHERE id = @id', {
['@id'] = k,
['@owner'] = v.owner,
['@money'] = v.money,
['@employes'] = json.encode(v.employes),
['@shop'] = json.encode(v.shop)
})
end
end
end)
Would it be possible to have an UPDATE to be able to resell the company to another player, or to remove the owner of the company via a menu?
Given that on discord the owner of the script no longer responds, and that his discord the ticket does not work, I allow myself to post here.