I would try something like this:
local vehicleModels = {
"blista",
"faggio",
"comet"
}
function getRandomVehicleModel()
local randomIndex = math.random(1, #vehicleModels)
return vehicleModels[randomIndex]
end
and then
local vehicleModel = getRandomVehicleModel()
local player = GetPlayerPed(-1)
local x, y, z = table.unpack(GetEntityCoords(player))
local heading = GetEntityHeading(player)
local vehicle = CreateVehicle(GetHashKey(vehicleModel), x, y, z, heading, true, false)
I did not try it out, but it should work.