You can do this by adding a table like local usedIds = {}
and then using something similar to table.insert(usedIds, id) when the vehicle spawns.
You then need to add a check, to see if the id is already used, with something similar to: if table.find(usedIds, id) then return print("ID already used!") end
If you need a script, let me know!
Otherwise, hope this helped!