we are having issues with this code for mechanics.
RegisterNetEvent(‘upgradeEngine’)
AddEventHandler(‘upgradeEngine’, function()
local plyCoords = GetEntityCoords(GetPlayerPed(-1), false)
local vehicle = ESX.Game.GetClosestVehicle(plyCoords)
-–SetVehicleModKit(vehicle, 0)
local props = {
modEngine = 1
}
upgrade(vehicle, props)
end)
function upgrade(vehicle, props)
ESX.Game.SetVehicleProperties(vehicle, props)
end
ESX.RegisterUsableItem(‘engineBasicTuningKit’, function(source)
local _source = source
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem('engineBasicTuningKit', 1)
TriggerClientEvent('upgradeEngine')
end)
` no errors throw what so ever. Uses the item as well. Just the actual setting of the mod doesnt’ happen Assuming
ESX.Game.SetVehicleProperties(vehicle, props)
Is what isnt’ working right, or the way I’m passing the properties? I really don’t know liek I said I dont’ get errors.
it’s setting up a useable item, that when used grabs closest vehicle and attempts to apply a modkit, specifically the enginemodkit to upgrade the engine just as in LScustoms