Pretty new to lua, and not sure what the issue is... Any ideas?
The lua code:
ESX.RegisterUsableItem('turtlebait', function(source)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer.getInventoryItem('fishingrod').count > 0 then
TriggerClientEvent('fishing:setbait', (source, "turtle")
xPlayer.removeInventoryItem('turtlebait', 1)
TriggerClientEvent('fishing:message', (source, "You attach the ~y~turtle bait~s~ onto your fishing rod")
else
TriggerClientEvent('fishing:message', (source, "~r~You don't have a fishing rod")
end
end)
Line 7: TriggerClientEvent('fishing:setbait', (source, "turtle")
you need to close all
TriggerClientEventfunctions