[vRP] Car Robery Script

Hello, i got a request from my vrp roleplay comunity. they want a car robery system. I thought about it and found two diferent scripts that may allow the car heist to happen.
The fist one ( don’t have the link at the moment ) allows cars to spawn on a pre configured location each time the ressource starts and then players should look for the cars and rob them. Different cars would have diferent money values if you could rob them and don’t get caught by the police meanwhile. For the police alert system i’ve found a ressouce ( [Release] StarPursuit ) that puts a tracker insdide a car and you can follow it’s location on the map, but it doesn’t alert anyone at the moment neither triggers the car location for everyone.

My objectives are:

  • you can rob cars, evade the cops for 5 minutes, take he car to the place where you get paid;
    -if you rob one of this cars only police will get the alert and the car location on real time in the map;(after five minutes the car tracker get’s deactivated);
    -diferent cars gives you a diferent ammount of money.

I am not a developer, i don’t know how to code properly, so i am asking for some help here because i think if we can reach realease all the comunity will take benefit with it.

EDIT:
i found this code part maybe it could be usefull:

Citizen.CreateThread(function()
  while true do
    Citizen.Wait(1)
    local ped = GetPlayerPed(-1)
    if IsPedTryingToEnterALockedVehicle(ped) or IsPedJacking(ped) then
      Citizen.Wait(2000) -- wait x seconds before setting wanted
      local ok,vtype,name = tvRP.getNearestOwnedVehicle(5)
      if not ok then -- prevent stealing detection on owned vehicle
        for i=0,4 do -- keep wanted for 1 minutes 30 seconds
          tvRP.applyWantedLevel(2)
          Citizen.Wait(15000)
        end
      end
      Citizen.Wait(15000) -- wait 15 seconds before checking again
    end
  end
end)

1 Like