This script was made to give some players the ability to find and own imported vehicles in a manor never seen before on any FiveM server.
This script could be better but I will leave that up to you guys and will leave the code none obfuscated.
What is Barn Finds?:
- Barn finds is a resource that allows you to put a run down vehicle anywhere on the map for a player to claim as there own.
- Once the vehicle is claimed that vehicle is then theres.
- Once claimed the player has to then use resources such as plastic and rubber to replensih the car back into good health.
- Once you have fufilled all resources needed the car will then get swooped into your garage and be able to drive it away.
- Barn finds on server restart will not lose its position.
- Vehicles in barns spawn fully broken.
Bad points (sort of):
- Only one vehicle can be out at a time, Even once claimed until that player has finished the repairs no other find can be put out.
- When the player has fully repaired there vehicle and then the server restarts if the script has not been turned off or stopped it will run again with the same car at the same location.
How do players use the resources and repair the vehicle?:
- This is currently done via commands as shown below.
/copper AMOUNT
/aluminium AMOUNT
/steel AMOUNT
/plastic AMOUNT
/glass AMOUNT
/rubber AMOUNT
PRE WARNING: In the server.lua on line 60 you will need to add your own garage systems storing method, This resource was made with BB Garages, Simple enough to do, Just go to your car shop resource and see how they do it. (I can also help with this if needed)
QBCore.Functions.ExecuteSql(false,"INSERT INTO `bbvehicles` (`citizenid`, `plate`, ` ETC ETC ETC
The script was made to be easily edited as shown below this is the config:
Config = {
VehicleName = 'challenger', --HERE YOU CHANGE THE CAR YOU WANT TO SPAWN
VehicleLoc = { --THE LOCATION OF WHERE THE VEHICLE WILL BE
x = 1981.8708,
y = 5174.2685,
z = 46.858005,
h = 130.32205,
},
VehicleCost = { --THE COST IN RESOURCES IT TAKES TO REPAIR THE VEHICLE
copper = 650,
aluminum = 650,
steel = 750,
plastic = 320,
glass = 150,
rubber = 200,
},
ShopLoc = { --WHERE THE CAR GOES ONCE CLAIMED
x = 103.88192,
y = 6623.1044,
z = 31.824226,
h = 224.93014,
},
IsClaimed = false, --DONT EDIT
Winner = nil, --DONT EDIT
WinnerCid = nil, --DONT EDIT
Bop = false, --DONT EDIT
}
SHOWCASE:
DEPENDANCIES:
ghmattmysql
qbcore
FEATURES:
- Unique system.
- Easily Configured.
- Made to be as efficient as possible.
GET IT HERE: https://kazumidevelopments.tebex.io/package/4991078
ESX VERSION THANKS TO @ToXicGlo > https://kazumidevelopments.tebex.io/package/4993790
If you run into issues please feel free to message me here on the FiveM Forums.