I can’t figure this out at all. I want to lock certain vehicle types on spawn and keep them locked. AI specifically. For example emergency vehicles and super vehicles. What I have now is down below, but this locks all vehicles instead of a specific “Type”
Citizen.CreateThread(function()
while true do
if DoesEntityExist(GetVehiclePedIsTryingToEnter(PlayerPedId())) then
local veh = GetVehiclePedIsTryingToEnter(PlayerPedId())
local lock = GetVehicleDoorLockStatus(veh)
local car = GetClosestVehicle(playerPos.x, playerPos.y, playerPos.z, 3.000, 0, 70)
if lock == 7 then
SetVehicleDoorsLocked(veh, 2)
end
local pedd = GetPedInVehicleSeat(veh, -1)
if pedd then
SetVehicleDoorsLocked(veh, 2)
end
end
Citizen.Wait(0)
end
end)