Claro que no va a funcionar con eso, porque no entras en un vehiculo, cambia el modelo nada mas, usa esto:
local colors =
{
{ 128, 255, 0 },
{ 43, 25, 255 },
{ 255, 2, 255 },
{ 0, 255, 247 },
{ 201, 255, 0 },
{ 255, 0, 0 },
{ 0, 81, 255 },
{ 252, 255, 36 },
{ 87, 16, 154 },
{ 255, 94, 0 }
}
addEventHandler ( 'onVehicleEnter', root,
function ( )
setVehicleColor ( source, unpack ( colors[ math.random ( #colors ) ] ) )
end
)
addEvent ( "onPlayerPickUpRacePickup", true )
addEventHandler ( "onPlayerPickUpRacePickup", root,
function ( pickupID, pickupType, vehicleModel )
if ( pickupType == "vehiclechange" ) then
local theVehicle = getPedOccupiedVehicle ( source )
setVehicleColor ( theVehicle, unpack ( colors[ math.random ( #colors ) ] ) )
end
end
)